 




 

 






typedef long int integer;
typedef unsigned long uinteger;
typedef char *address;
typedef short int shortint;
typedef float real;
typedef double doublereal;
typedef struct { real r, i; } complex;
typedef struct { doublereal r, i; } doublecomplex;
typedef long int logical;
typedef short int shortlogical;
typedef char logical1;
typedef char integer1;





 




 


typedef long int flag;
typedef long int ftnlen;
typedef long int ftnint;


 
typedef struct
{	flag cierr;
	ftnint ciunit;
	flag ciend;
	char *cifmt;
	ftnint cirec;
} cilist;

 
typedef struct
{	flag icierr;
	char *iciunit;
	flag iciend;
	char *icifmt;
	ftnint icirlen;
	ftnint icirnum;
} icilist;

 
typedef struct
{	flag oerr;
	ftnint ounit;
	char *ofnm;
	ftnlen ofnmlen;
	char *osta;
	char *oacc;
	char *ofm;
	ftnint orl;
	char *oblnk;
} olist;

 
typedef struct
{	flag cerr;
	ftnint cunit;
	char *csta;
} cllist;

 
typedef struct
{	flag aerr;
	ftnint aunit;
} alist;

 
typedef struct
{	flag inerr;
	ftnint inunit;
	char *infile;
	ftnlen infilen;
	ftnint	*inex;	 
	ftnint	*inopen;
	ftnint	*innum;
	ftnint	*innamed;
	char	*inname;
	ftnlen	innamlen;
	char	*inacc;
	ftnlen	inacclen;
	char	*inseq;
	ftnlen	inseqlen;
	char 	*indir;
	ftnlen	indirlen;
	char	*infmt;
	ftnlen	infmtlen;
	char	*inform;
	ftnint	informlen;
	char	*inunf;
	ftnlen	inunflen;
	ftnint	*inrecl;
	ftnint	*innrec;
	char	*inblank;
	ftnlen	inblanklen;
} inlist;



union Multitype {	 
	integer1 g;
	shortint h;
	integer i;
	 
	real r;
	doublereal d;
	complex c;
	doublecomplex z;
	};

typedef union Multitype Multitype;

 	 

struct Vardesc {	 
	char *name;
	char *addr;
	ftnlen *dims;
	int  type;
	};
typedef struct Vardesc Vardesc;

struct Namelist {
	char *name;
	Vardesc **vars;
	int nvars;
	};
typedef struct Namelist Namelist;











 



typedef int   (*U_fp)();
typedef shortint (*J_fp)();
typedef integer (*I_fp)();
typedef real (*R_fp)();
typedef doublereal (*D_fp)(), (*E_fp)();
typedef   void  (*C_fp)();
typedef   void  (*Z_fp)();
typedef logical (*L_fp)();
typedef shortlogical (*K_fp)();
typedef   void  (*H_fp)();
typedef   int (*S_fp)();

 
typedef void  C_f;	 
typedef void  H_f;	 
typedef void  Z_f;	 
typedef doublereal E_f;	 

 
























 

struct {
    integer ierro;
} erro_;



struct {
    char erbez[16];
} erroc_;



struct {
    doublereal pi, pi2, pisqrt, rad;
} kons_;



struct {
    integer il, mper, mblo, mbloz, msym[16], kanf, iu, ic[20000];
} str_;



struct {
    doublereal ed[700], el[700], ek[700], sm[700];
    integer kz[700], kp[700];
} ell_;



struct {
    doublereal xpl[700], xrms[700], zpl[700], zrms[700];
} pla_;



struct {
    integer mel[300], mtyp[30000]	 , mstr[300];
} str2_;



struct {
    doublereal a[8400]	 , bl1[3600]	 
, bl2[3600]	 ;
} mat_;



struct {
    doublereal rvf[6];
} syos2_;



struct {
    doublereal rat;
    integer idfor, napx, napxo, numl, numlr, nde[2], nwr[4], ird, imc, irew, 
	    ntwin, iclo6, iclo6r, iver, ibidu;
} tra1_;



struct {
    doublereal qs, e0, pma, ej[6], ejf[6], phas0, phas, hsy[3], crad, hsyc[
	    700], phasc[700], dppoff, sigmoff[20000], tlen;
    integer iicav, itionc[700], ition, idp, ncy, ixcav;
} syn_;



struct {
    doublereal dpscor, sigcor;
    integer icode, idam, its6d;
} cor_;



struct {
    doublereal bk0[7700]	 , ak0[7700]	 
, bka[7700]	 , aka[7700]	 
;
} multi_;



struct {
    doublereal benki, benkc[700], r00[700];
    integer irm[700], nmu[700];
} mult1_;



struct {
    doublereal zfz[300000];
    integer iorg, mzu[20000], izu0, mmac, mcut;
} rand0_;



struct {
    char bezr[33600]	 ;
} rand0c_;



struct {
    doublereal exterr[800000]	 , extalign[60000]	 
, tiltc[20000], tilts[20000];
    integer mout2, icext[20000], icextal[20000];
} rand1_;



struct {
    doublereal aper[2], di0[2], dip0[2], ta[36]	 ;
} beo_;



struct {
    doublereal dma, dmap, dkq, dqq, de0, ded, dsi, dech, dsm0;
    integer itco, itcro, itqv, iout;
} clo_;



struct {
    doublereal qw0[3], amp0;
    integer iq[3], iqmod, kpa[700], iqmod6;
} qmodi_;



struct {
    doublereal elbe[300];
    integer ilin, nt, iprint, ntco;
    doublereal eui, euii;
    integer nlin;
} linop_;



struct {
    char bez[11200], bezb[4800], bezl[11200];
} linopc_;



struct {
    doublereal betam[1200]	 , pam[1200]	 
, betac[1200]	 , pac[1200]	 
, bclorb[1200]	 ;
    integer nhmoni, nhcorr, nvmoni, nvcorr, ncororb[700];
} cororb_;



struct {
    doublereal apx[700], apz[700];
} apert_;



struct {
    doublereal sigma0[2];
    integer iclo, ncorru, ncorrep;
} clos_;



struct {
    integer icomb0[20], icomb[2000]	 ;
    doublereal ratio[2000]	 , ratioe[700];
    integer iratioe[700], icoe;
} combin_;



struct {
    integer ise, mesa, mp, m21, m22, m23, ise1, ise2, ise3, isea[700];
} sea_;



struct {
    doublereal qxt, qzt, tam1, tam2;
    integer isub, nta, nte, ipt;
    doublereal totl;
} subres_;



struct {
    doublereal rtc[8100]	 , rts[8100]	 
;
    integer ire[12], ipr[5], irmod2;
} secom_;



struct {
    doublereal dtr[10];
    integer nre, nur, nch, nqc, npp, nrr[5], nu[5];
} secom1_;



struct {
    doublereal dphix, dphiz, qx0, qz0, dres, dfft, cma1, cma2;
    integer nstart, nstop, iskip, iconv, imad;
} postr_;



struct {
    integer ipos, iav, iwg, ivox, ivoz, ires, ifh;
} posti1_;



struct {
    char toptit[400];
} posti3_;



struct {
    integer kwtype, itf, icr, idis, icow, istw, iffw, nprint, ndafi;
} posti2_;



struct {
    integer irip, irco;
    doublereal ramp[700], rfre[700], rzph[700];
    integer nrel[700];
} ripp_;



struct {
    integer nrturn;
} ripp2_;



struct {
    doublereal qwsk[2], betx[2], betz[2], alfx[2], alfz[2];
    integer iskew, nskew[6];
} skew_;



struct {
    char sixtit[80], commen[80];
} titc_;



struct {
    integer ithick;
} tit_;



struct {
    doublereal clo6[3], clop6[3];
} co6d_;



struct {
    doublereal dki[2100]	 ;
} dkic_;



struct {
    doublereal clobaux[1400]	 , sigman[89600]	 
, sigman6[1400]	 , sigman2[
	    89600]	 , sigmanq[89600]	 
, clobeam[89600]	 , beamoff[89600]
	    	 , partnum, emitnx, emitnz, gammar;
    integer nbeam, nvbeam, ibeco, ibtyp;
} beam_;



struct {
    doublereal as[537600]	 , al[537600]	 
, sigm[6], dps[6];
    integer idz[2];
} syos_;



struct {
    doublereal chi0, chid, exz[12]	 , dp1;
    integer itra;
} anf_;



union {
    struct {
	doublereal x[12]	 , y[12]	 , amp[
		2], bet0[2], alf0[2], clo[2], clop[2];
    } _1;
    struct {
	doublereal xxtr[12]	 , yytr[12]	 
, amp[2], bet0[2], alf0[2], clo[2], clop[2];
    } _2;
} tra_;




union {
    struct {
	doublereal cro[2];
	integer is[2], ichrom;
    } _1;
    struct {
	doublereal cro[2];
	integer issss[2], ichrom;
    } _2;
} chrom_;




struct {
    doublereal preda;
    integer idial, nord, nvar, nvar2, nsix, ncor, ipar[10], idalloc;
} dial_;



struct {
    integer nordf, nvarf, inorm, imod1, imod2;
} norf_;



struct {
    integer icorr, nctype, namp, nmom, nmom1, nmom2;
    doublereal weig1, weig2, dpmax;
} tcorr_;



struct {
    char coel[160];
} tcorrc_;



struct {
    doublereal angle[3], abm[68921]	 , aam[68921]	
	     , tue[68921]	 ;
} tune_;



struct {
    doublereal sta[3], dsta[3];
} stable_;



struct {
    integer no, nv;
} ii_;



struct {
    integer iscrda[100];
    doublereal rscrri[100];
    integer iscrri[100], idao;
} dascr_;



struct {
    doublereal dani[1001];
} invari_;



struct {
    doublereal aml6[36]	 , edcor[2];
    integer mapout;
} sixdim_;



union {
    struct {
	doublereal p[60000]	 ;
    } _1;
    struct {
	doublereal phase[60000]	 ;
    } _2;
} phase_;




struct {
    integer bb2, rot[12], roti[12], ctr[12], cjg[12], rtc[12], bb1, rel[12];
} nom_;



struct {
    integer v[12], w[12], x[12], xy[12], h__, ft, a2[12], a2i[12], cm[12], a1[
	    12], a1i[12];
} vecteur_;



struct {
    integer hs, fs;
} super_;



struct {
    doublereal tasm[36]	 ;
} tasm_;



struct {
    doublereal xsi[20000], zsi[20000], smi[20000], aai[220000]	 
, bbi[220000]	 ;
} xz_;



struct {
    doublereal rsmi[20000], rfres[20000], rzphs[20000];
} rfres_;



struct {
    doublereal damp, ampt;
} damp_;



struct {
    doublereal ekv[44800]	 , fokqv[64], aaiv[220000]	
	     , bbiv[220000]	 
, smiv[20000]	 , zsiv[20000]	 
, xsiv[20000]	 , xsv[64],
	     zsv[64], qw[2], qwc[3], clo0[2], clop0[2], eps[2], epsa[2], ekk[
	    2], cr[11], ci[11], xv[128]	 , yv[128]	 
, dam[64], ekkv[64], sigmv[64], dpsv[64], dp0v[64], 
	    sigmv6[64], dpsv6[64], ejv[64], ejfv[64], xlv[64], zlv[64];
    logical pstop[64];
    doublereal rvv[64], ejf0v[64];
    integer numxv[64], nms[64], nlostp[64];
} main1_;



struct {
    doublereal dpd[64], dpsq[64], fok[64], rho[64], fok1[64], si[64], co[64], 
	    g[64], gl[64], sm1[64], sm2[64], sm3[64], sm12[64], as3[64], as4[
	    64], as6[64], sm23[64], rhoc[64], siq[64], aek[64], afok[64], hp[
	    64], hm[64], hc[64], hs[64], wf[64], wfa[64], wfhi[64], rhoi[64], 
	    hi[64], fi[64], hi1[64], xvl[128]	 , yvl[128]	
	     , ejvl[64], dpsvl[64], oidpsv[64], sigmvl[64];
    integer iv[64];
    doublereal aperv[128]	 ;
    integer ixv[64];
    doublereal clov[128]	 , clopv[128]	 
, alf0v[128]	 , bet0v[128]	 
, ampv[64];
} main2_;



struct {
    doublereal clo6v[192]	 , clop6v[192]	 
, hv[230400]	 , bl1v[230400]	 
, tas[2304]	 , qwcs[
	    192]	 , di0xs[64], di0zs[64], dip0xs[64], 
	    dip0zs[64], xau[12]	 , cloau[6], di0au[4], tau[36]	
	     , tasau[2304]	 , wx[3], 
	    x1[6], x2[6], fake[40]	 ;
} main3_;



struct {
    doublereal e0f;
    integer numx;
} main4_;



struct {
    integer ktrack[20000];
    doublereal strack[20000], strackc[20000], stracks[20000], dpsv1[64];
    integer nwri;
} track_;



struct {
    integer alda[12]	 , asda[12]	 , 
	    aldaq[12]	 , asdaq[12]	 , 
	    smida[10], dpda, dpda1, sigmda, ej1, ejf1, rv;
} daele_;



struct {
    doublereal ald6[126000]	 , asd6[126000]	 
;
} dael6_;



struct {
    doublereal cc[100000];
    integer i1[100000], i2[100000], ie1[500], ie2[500], ieo[500], ia1[501], 
	    ia2[501], ifi[500], idano[10000], idanv[10000], idapo[10000], 
	    idalm[10000], idall[10000], nda, nst, nomax, nvmax, nmmax, nocut;
    doublereal eps, epsmac;
    integer lfi;
} da_;



struct {
    char daname[100000];
} daname_;



struct {
    doublereal sgma, aml[36]	 , am[36]	 
, eval, dlya, xlya[6];
} lya_;



struct {
    doublereal aml6[36]	 , xlya6[6];
} lya6_;



struct {
    doublereal epss;
    integer nitera;
} newton_;



struct {
    integer nnumxv[64];
} postr2_;



struct {
    integer ista[3], idsta[3];
} istable_;



struct {
    doublereal hrecip;
    integer kstep;
} wzcom1_;



struct {
    doublereal wtreal[232224], wtimag[232224];
} wzcom2_;



 

static integer c__12 = 12;
static integer c__1 = 1;
static integer c__0 = 0;
static integer c__11 = 11;
static integer c__13 = 13;
static integer c__2 = 2;
static integer c__6 = 6;
static integer c__9 = 9;
static integer c__36 = 36;
static integer c__14 = 14;
static integer c__4 = 4;
static doublereal c_b251 = 0.;
static integer c__5 = 5;
static integer c__84 = 84;
static integer c__600 = 600;
static integer c__3 = 3;
static doublereal c_b461 = .5;
static doublereal c_b464 = -.5;
static integer c__100 = 100;
static integer c__85 = 85;
static integer c__58 = 58;
static integer c__57 = 57;
static integer c__15 = 15;
static integer c__16 = 16;
static integer c__59 = 59;
static integer c__17 = 17;
static integer c__18 = 18;
static integer c__26 = 26;
static integer c__19 = 19;
static integer c__20 = 20;
static integer c__21 = 21;
static integer c__40 = 40;
static integer c__91 = 91;
static integer c__52 = 52;
static integer c__65 = 65;
static integer c__67 = 67;
static integer c__66 = 66;
static integer c__45 = 45;
static integer c__81 = 81;
static integer c__27 = 27;
static integer c__25 = 25;
static integer c__28 = 28;
static integer c__55 = 55;
static integer c_b1102 = 300000;
static integer c__80 = 80;
static integer c__86 = 86;
static integer c__87 = 87;
static integer c__29 = 29;
static integer c__8 = 8;
static integer c__44 = 44;
static integer c__83 = 83;
static integer c__82 = 82;
static integer c__92 = 92;
static integer c__37 = 37;
static integer c__46 = 46;
static integer c__47 = 47;
static integer c__48 = 48;
static integer c__49 = 49;
static integer c__50 = 50;
static integer c__7 = 7;
static integer c__39 = 39;
static integer c__51 = 51;
static integer c__62 = 62;
static integer c__63 = 63;
static integer c__78 = 78;
static integer c__70 = 70;
static integer c__71 = 71;
static integer c__72 = 72;
static integer c__73 = 73;
static integer c__74 = 74;
static integer c__75 = 75;
static integer c__76 = 76;
static integer c__77 = 77;
static integer c__88 = 88;
static integer c__41 = 41;
static integer c__42 = 42;
static integer c__54 = 54;
static integer c__64 = 64;
static doublereal c_b2366 = 1.;
static doublereal c_b2381 = -1.;
static doublereal c_b2382 = 2e3;
static doublereal c_b2384 = 1e3;
static doublereal c_b2400 = 2.;
static doublereal c_b2414 = 4e3;
static doublereal c_b2415 = 4.;
static integer c__33 = 33;
static doublereal c_b2856 = 5.3300000000000001;
static doublereal c_b2858 = 4.29;
static doublereal c_b2862 = 3.2000000000000002;
static doublereal c_b2869 = 1.1283791670955099;
static integer c__700 = 700;
static integer c__300 = 300;
static integer c_b3071 = 280000;
static integer c__500 = 500;
static integer c__10 = 10;
static integer c_n1 = -1;
static doublereal c_b4017 = 3.;
static doublereal c_b4018 = 5.;
static doublereal c_b4019 = 7.;
static integer c__90 = 90;
static integer c__20000 = 20000;
static integer c_n20 = -20;
static integer c_n111 = -111;
static doublereal c_b5817 = .15;
static integer c__30000 = 30000;
static integer c__8400 = 8400;
static integer c__3600 = 3600;
static integer c__7700 = 7700;
static integer c__2100 = 2100;
static integer c_b6183 = 800000;
static integer c__60000 = 60000;
static integer c__1200 = 1200;
static integer c__2000 = 2000;
static integer c__8100 = 8100;
static integer c__1400 = 1400;
static integer c__89600 = 89600;
static integer c_b6341 = 537600;
static integer c_b6360 = 220000;
static integer c__44800 = 44800;
static integer c__128 = 128;
static integer c__192 = 192;
static integer c_b6475 = 230400;
static integer c__2304 = 2304;
static integer c__56 = 56;
static integer c__79 = 79;
static integer c__30 = 30;
static integer c__31 = 31;
static integer c__32 = 32;
static integer c__34 = 34;
static doublereal c_b8147 = 15.;
static doublereal c_b8151 = .24;
static doublereal c_b8153 = .19;
static doublereal c_b8155 = 1.5;
static doublereal c_b8515 = 1e-17;
static integer c__1000 = 1000;
static doublereal c_b8642 = 14.75;
static doublereal c_b8645 = 99.;
static doublereal c_b8648 = 14.5;
static doublereal c_b8654 = 14.25;
static doublereal c_b8660 = 14.;
static integer c__35 = 35;
static integer c__38 = 38;
static integer c__89 = 89;
static doublereal c_b10606 = .001;
static integer c__93 = 93;
static doublereal c_b10710 = 9.9999999999999995e-7;
static doublereal c_b10711 = 1.0000000000000001e-9;
static doublereal c_b10712 = 9.9999999999999998e-13;
static doublereal c_b10713 = 1.0000000000000001e-15;
static doublereal c_b10714 = 1.0000000000000001e-18;
static doublereal c_b10715 = 9.9999999999999991e-22;
static doublereal c_b10716 = 9.9999999999999992e-25;
static doublereal c_b11165 = .27525512860000001;
static doublereal c_b11166 = .51242422480000005;
static doublereal c_b11168 = 2.7247448714;
static doublereal c_b11169 = .051765358800000001;

  int abend_()
{
     
      int s_stop();

 
    s_stop("99", 2L);
}  

 
 
  int adia_(numx, e0f)
integer *numx;
doublereal *e0f;
{
     
    double sin(), sqrt();

 

 
 

 

    if (*numx == 1) {
	syn_ .phas0 = syn_ .phas;
    }
    if (*numx <= tra1_ .nde[0]) {
	syn_ .phas = 0.;
    }
    if (*numx <= tra1_ .nde[0]) {
	return 0;
    }
    if (*numx > tra1_ .nde[1]) {
	syn_ .phas = 0.;
    }
    if (*numx > tra1_ .nde[1]) {
	return 0;
    }
    syn_ .phas = syn_ .phas0;
    syn_ .e0 += syn_ .hsy[0] * sin(syn_ .phas);
    *e0f = sqrt(syn_ .e0 * syn_ .e0 - syn_ .pma * syn_ .pma);
    return 0;
}  

 
 
  int adib_(numx, e0f)
integer *numx;
doublereal *e0f;
{
     
    double sin(), sqrt();

 

 
 

 

    if ((( syn_ .phas0 ) >= 0 ? ( syn_ .phas0 ) : -( syn_ .phas0 ))  <= 1e-17) {
	return 0;
    }
    syn_ .e0 += syn_ .hsy[0] * sin(syn_ .phas);
    *e0f = sqrt(syn_ .e0 * syn_ .e0 - syn_ .pma * syn_ .pma);
    return 0;
}  

 
  int ambm6_(no, iham)
integer *no, *iham;
{
     
    integer i__1, i__2, i__3, i__4;
    doublereal d__1, d__2;

     
    double cos(), exp(), sinh(), sin();

     
    static integer i__, j, k;
    static doublereal ad;
    static integer ic;
    static doublereal co, as, ex;
    static integer mx[60]	 ;
    static doublereal ad1, ad2, ad3, an1, an2, an3, as1, as2, as3, ans, exh;
    static integer ires, nres;

 
 
 
 
 
 
    nres = 0;
    i__1 = *no;
    for (i__ = -(*no); i__ <= i__1; ++i__) {
	i__2 = *no;
	for (j = -(*no); j <= i__2; ++j) {
	    i__3 = *no;
	    for (k = -(*no); k <= i__3; ++k) {
		tune_ .abm[i__ + (j + k * 41) * 41 + 34460] = 0.;
		tune_ .aam[i__ + (j + k * 41) * 41 + 34460] = 0.;
		tune_ .tue[i__ + (j + k * 41) * 41 + 34460] = 1.;
		if (nres == -1) {
		    goto L20;
		}
		if ((( i__ ) >= 0 ? ( i__ ) : -( i__ ))  + (( j ) >= 0 ? ( j ) : -( j ))  + (( k ) >= 0 ? ( k ) : -( k ))  > *no) {
		    goto L20;
		}
		if ((( i__ ) >= 0 ? ( i__ ) : -( i__ ))  + (( j ) >= 0 ? ( j ) : -( j ))  + (( k ) >= 0 ? ( k ) : -( k ))  != 0) {
		    ires = 0;
		    i__4 = nres;
		    for (ic = 1; ic <= i__4; ++ic) {
			if (mx[ic * 3 - 3] == i__ && mx[ic * 3 - 2] == j && 
				mx[ic * 3 - 1] == k) {
			    ires = 1;
			}
			if (mx[ic * 3 - 3] == -i__ && mx[ic * 3 - 2] == -j && 
				mx[ic * 3 - 1] == -k) {
			    ires = 1;
			}
			if (ires == 1) {
			    goto L20;
			}
 
		    }
		    an1 = i__ * tune_ .angle[0];
		    an2 = j * tune_ .angle[1];
		    an3 = k * tune_ .angle[2];
		    ad1 = an1 * stable_ .dsta[0];
		    ad2 = an2 * stable_ .dsta[1];
		    ad3 = an3 * stable_ .dsta[2];
		    ad = ad1 + ad2 + ad3;
		    as1 = an1 * stable_ .sta[0];
		    as2 = an2 * stable_ .sta[1];
		    as3 = an3 * stable_ .sta[2];
		    as = as1 + as2 + as3;
 
		    if (*iham != 1) {
			co = cos(as);
			exh = exp(ad / 2.);
 
			d__1 = exh;
			ex = d__1 * d__1;
 
			d__1 = sinh(ad / 2.);
 
			d__2 = sin(as / 2.);
			ans = ex * 4. * (d__1 * d__1 + d__2 * d__2);
 
			d__1 = sin(as / 2.);
			tune_ .aam[i__ + (j + k * 41) * 41 + 34460] = (-exh * 
				sinh(ad / 2.) + ex * (d__1 * d__1)) * 2. / 
				ans;
			tune_ .abm[i__ + (j + k * 41) * 41 + 34460] = sin(as) 
				* ex / ans;
			tune_ .tue[i__ + (j + k * 41) * 41 + 34460] = 0.;
		    } else {
 
			d__1 = ad;
 
			d__2 = as;
			ans = d__1 * d__1 + d__2 * d__2;
			tune_ .abm[i__ + (j + k * 41) * 41 + 34460] = as / 
				ans;
			tune_ .aam[i__ + (j + k * 41) * 41 + 34460] = -ad / 
				ans;
			tune_ .tue[i__ + (j + k * 41) * 41 + 34460] = 0.;
		    }
		}
L20:
		;
	    }
 
	}
 
    }
    return 0;
}  

 
  int analie6_(h__, ft, cjg, ctr, rtc)
integer *h__, *ft, *cjg, *ctr, *rtc;
{
     

    static integer b1 = 0;
    static integer b2 = 0;
    static integer bm = 0;
    static integer b4 = 0;

    extern   int trx6_(), resb6_(), dadal_(), daall_(), 
	    cpart6_();

 
 
 
 
 
 


     
    --rtc;
    --ctr;
    --cjg;

     

    daall_(&cjg[1], &c__12, "CJG       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&ctr[1], &c__12, "CTR       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&rtc[1], &c__12, "RTC       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(h__, &c__1, "H         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(ft, &c__1, "FT        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&b1, &c__1, "B1        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&b2, &c__1, "B2        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&bm, &c__1, "BM        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&b4, &c__1, "B4        ", & ii_ .no, & ii_ .nv, 10L);
 
 
    cpart6_(h__, &b1);
 
    trx6_(&b1, &bm, &ctr[1]);
 
 
    resb6_(&bm, &b4, &cjg[1]);
 
    trx6_(&bm, &b1, &rtc[1]);
    trx6_(&b4, &b2, &rtc[1]);
 
    cpart6_(&b1, h__);
    cpart6_(&b2, ft);
    dadal_(&b4, &c__1);
    dadal_(&bm, &c__1);
    dadal_(&b2, &c__1);
    dadal_(&b1, &c__1);
    return 0;
}  

 
 
  int betalf_(dpp, qw)
doublereal *dpp, *qw;
{
     
    double sqrt(), atan();

     
    static integer i__, j;
    static doublereal f0, f1, f2, am[16]	 , rn1, rn2, 
	    rcw1[4], ycw1[4], rcw2[4], ycw2[4], spa, spd, det, egwg1, egwg2, 
	    rca1, yca1, rca2, yca2, detb, detc, fak1, fak2, sqrn, rclam1, 
	    rclam2, yclam1, yclam2;
    extern   int matrix_();

 

 
 
 

 

     
    --qw;

     
    erro_ .ierro = 0;
    matrix_(dpp, am);
 
 
    spa = am[0] + am[5];
    spd = am[10] + am[15];
    det = (am[8] + am[7]) * (am[13] + am[2]) - (am[12] - am[6]) * (am[9] - am[
	    3]);
    f0 = spa - spd;
    f1 = spa + spd;
    f2 = f0 * f0 + det * 4.;
    if (f2 < 0.) {
	goto L160;
    }
    f2 = sqrt(f2);
    if (f0 >= 0.) {
	goto L20;
    } else {
	goto L30;
    }
L20:
    egwg1 = (f1 + f2) * .5;
    egwg2 = (f1 - f2) * .5;
    goto L40;
L30:
    egwg1 = (f1 - f2) * .5;
    egwg2 = (f1 + f2) * .5;
L40:
    f1 = egwg1 * egwg1 - 4.;
    f2 = egwg2 * egwg2 - 4.;
    rca1 = f1;
    yca1 = 0.;
    rca2 = f2;
    yca2 = 0.;
    if (rca1 >= 0.) {
	rca1 = sqrt(rca1);
    } else {
	yca1 = sqrt(-rca1);
	rca1 = 0.;
    }
    if (rca2 >= 0.) {
	rca2 = sqrt(rca2);
    } else {
	yca2 = sqrt(-rca2);
	rca2 = 0.;
    }
    rclam1 = (egwg1 + rca1) / 2.;
    yclam1 = yca1 / 2.;
    rclam2 = (egwg2 + rca2) / 2.;
    yclam2 = yca2 / 2.;
    if (egwg1 * egwg1 >= 4.) {
	goto L160;
    }
    if (egwg2 * egwg2 >= 4.) {
	goto L160;
    }
 
    detb = am[8] * am[13] - am[12] * am[9];
    detc = am[2] * am[7] - am[6] * am[3];
    fak1 = spd - egwg1;
    if ((( fak1 ) >= 0 ? ( fak1 ) : -( fak1 ))  > 1e-17) {
	rcw1[0] = -(am[8] * am[6] + am[12] * am[7]) / fak1 + am[4];
	ycw1[0] = 0.;
	rcw1[1] = (am[8] * am[2] + am[12] * am[3] + detb) / fak1 - (am[0] - 
		rclam1);
	ycw1[1] = yclam1;
	rcw1[2] = -((am[2] + am[13]) * rcw1[0] + (am[6] - am[12]) * rcw1[1]) /
		 fak1;
	ycw1[2] = -((am[2] + am[13]) * ycw1[0] + (am[6] - am[12]) * ycw1[1]) /
		 fak1;
	rcw1[3] = -((am[3] - am[9]) * rcw1[0] + (am[7] + am[8]) * rcw1[1]) / 
		fak1;
	ycw1[3] = -((am[3] - am[9]) * ycw1[0] + (am[7] + am[8]) * ycw1[1]) / 
		fak1;
    } else {
	rcw1[0] = am[4];
	ycw1[0] = 0.;
	rcw1[1] = -am[0] + rclam1;
	ycw1[1] = yclam1;
	rcw1[2] = 0.;
	ycw1[2] = 0.;
	rcw1[3] = 0.;
	ycw1[3] = 0.;
    }
    fak2 = spa - egwg2;
    if ((( fak2 ) >= 0 ? ( fak2 ) : -( fak2 ))  > 1e-17) {
	rcw2[2] = -(am[2] * am[12] + am[6] * am[13]) / fak2 + am[14];
	ycw2[2] = 0.;
	rcw2[3] = (am[2] * am[8] + am[6] * am[9] + detc) / fak2 - (am[10] - 
		rclam2);
	ycw2[3] = yclam2;
	rcw2[0] = -((am[8] + am[7]) * rcw2[2] + (am[12] - am[6]) * rcw2[3]) / 
		fak2;
	ycw2[0] = -((am[8] + am[7]) * ycw2[2] + (am[12] - am[6]) * ycw2[3]) / 
		fak2;
	rcw2[1] = -((am[9] - am[3]) * rcw2[2] + (am[13] + am[2]) * rcw2[3]) / 
		fak2;
	ycw2[1] = -((am[9] - am[3]) * ycw2[2] + (am[13] + am[2]) * ycw2[3]) / 
		fak2;
    } else {
	rcw2[2] = am[14];
	ycw2[2] = 0.;
	rcw2[3] = -am[10] + rclam2;
	ycw2[3] = yclam2;
	rcw2[0] = 0.;
	ycw2[0] = 0.;
	rcw2[1] = 0.;
	ycw2[1] = 0.;
    }
 
    for (i__ = 1; i__ <= 4; ++i__) {
	beo_ .ta[i__ - 1] = rcw1[i__ - 1];
	beo_ .ta[i__ + 11] = rcw2[i__ - 1];
	beo_ .ta[i__ + 5] = ycw1[i__ - 1];
	beo_ .ta[i__ + 17] = ycw2[i__ - 1];
 
    }
 
    rn1 = beo_ .ta[0] * beo_ .ta[7] - beo_ .ta[1] * beo_ .ta[6] + beo_ .ta[2] 
	    * beo_ .ta[9] - beo_ .ta[3] * beo_ .ta[8];
    if (rn1 < 0.) {
	goto L70;
    } else if (rn1 == 0) {
	goto L160;
    } else {
	goto L90;
    }
L70:
    yclam1 = -yclam1;
    for (i__ = 1; i__ <= 4; ++i__) {
 
	beo_ .ta[i__ + 5] = - beo_ .ta[i__ + 5];
    }
L90:
    sqrn = sqrt(((( rn1 ) >= 0 ? ( rn1 ) : -( rn1 )) ));
    for (i__ = 1; i__ <= 4; ++i__) {
	beo_ .ta[i__ - 1] /= sqrn;
 
	beo_ .ta[i__ + 5] /= sqrn;
    }
    rn2 = beo_ .ta[12] * beo_ .ta[19] - beo_ .ta[13] * beo_ .ta[18] + 
	    beo_ .ta[14] * beo_ .ta[21] - beo_ .ta[15] * beo_ .ta[20];
    if (rn2 < 0.) {
	goto L110;
    } else if (rn2 == 0) {
	goto L160;
    } else {
	goto L130;
    }
L110:
    yclam2 = -yclam2;
    for (i__ = 1; i__ <= 4; ++i__) {
 
	beo_ .ta[i__ + 17] = - beo_ .ta[i__ + 17];
    }
L130:
    sqrn = sqrt(((( rn2 ) >= 0 ? ( rn2 ) : -( rn2 )) ));
    for (i__ = 1; i__ <= 4; ++i__) {
	beo_ .ta[i__ + 11] /= sqrn;
 
	beo_ .ta[i__ + 17] /= sqrn;
    }
    qw[1] = atan(yclam1 / (rclam1 + 1.)) / kons_ .pi;
    qw[2] = atan(yclam2 / (rclam2 + 1.)) / kons_ .pi;
 

 
 

    skew_ .betx[0] = beo_ .ta[0] * beo_ .ta[0] + beo_ .ta[6] * beo_ .ta[6];
    skew_ .alfx[0] = -(beo_ .ta[0] * beo_ .ta[1] + beo_ .ta[6] * beo_ .ta[7]);
    skew_ .betx[1] = beo_ .ta[12] * beo_ .ta[12] + beo_ .ta[18] * beo_ .ta[18]
	    ;
    skew_ .alfx[1] = -(beo_ .ta[12] * beo_ .ta[13] + beo_ .ta[18] * beo_ .ta[
	    19]);
    skew_ .betz[0] = beo_ .ta[2] * beo_ .ta[2] + beo_ .ta[8] * beo_ .ta[8];
    skew_ .alfz[0] = -(beo_ .ta[2] * beo_ .ta[3] + beo_ .ta[8] * beo_ .ta[9]);
    skew_ .betz[1] = beo_ .ta[14] * beo_ .ta[14] + beo_ .ta[20] * beo_ .ta[20]
	    ;
    skew_ .alfz[1] = -(beo_ .ta[14] * beo_ .ta[15] + beo_ .ta[20] * beo_ .ta[
	    21]);
    (tra_._1) .bet0[0] = skew_ .betx[0];
    (tra_._1) .alf0[0] = skew_ .alfx[0];
    (tra_._1) .bet0[1] = skew_ .betz[1];
    (tra_._1) .alf0[1] = skew_ .alfz[1];
    if (beo_ .ta[0] < -1e-17) {
	for (i__ = 1; i__ <= 4; ++i__) {
	    for (j = 1; j <= 4; ++j) {
		beo_ .ta[i__ + j * 6 - 7] = - beo_ .ta[i__ + j * 6 - 7];
 
	    }
	}
    }
    return 0;
 

L160:
    erro_ .ierro = 1;
    return 0;
}  

 
 
  int block_()
{
     
    integer i__1, i__2;

     
    static doublereal g[3600]	 , h__[3600]	 
;
    static integer i__, j, k, l, m, n, jm;

 

 
 

 

    i__1 = str_ .mblo;
    for (k = 1; k <= i__1; ++k) {
	jm = str2_ .mel[k - 1];
	i__ = str2_ .mtyp[k - 1];
	n = str2_ .mtyp[k + jm * 300 - 301];
	for (l = 1; l <= 2; ++l) {
	    for (m = 1; m <= 6; ++m) {
		h__[(l + (m << 1)) * 300 - 900] = mat_ .a[i__ + (l + (m << 1))
			 * 700 - 2101];
 
		g[(l + (m << 1)) * 300 - 900] = mat_ .a[n + (l + (m << 1)) * 
			700 - 2101];
	    }
	}
	if (jm == 1) {
	    goto L40;
	}
	i__2 = jm;
	for (j = 2; j <= i__2; ++j) {
	    i__ = str2_ .mtyp[k + j * 300 - 301];
	    n = str2_ .mtyp[k + (jm - j + 1) * 300 - 301];
	    for (l = 1; l <= 2; ++l) {
		h__[j + (l + 2) * 300 - 901] = h__[j - 1 + (l + 2) * 300 - 
			901] * mat_ .a[i__ + (l + 2) * 700 - 2101] + h__[j - 
			1 + (l + 6) * 300 - 901] * mat_ .a[i__ + (l + 4) * 
			700 - 2101];
		h__[j + (l + 4) * 300 - 901] = h__[j - 1 + (l + 4) * 300 - 
			901] * mat_ .a[i__ + (l + 2) * 700 - 2101] + h__[j - 
			1 + (l + 8) * 300 - 901] * mat_ .a[i__ + (l + 4) * 
			700 - 2101];
		h__[j + (l + 6) * 300 - 901] = h__[j - 1 + (l + 2) * 300 - 
			901] * mat_ .a[i__ + (l + 6) * 700 - 2101] + h__[j - 
			1 + (l + 6) * 300 - 901] * mat_ .a[i__ + (l + 8) * 
			700 - 2101];
		h__[j + (l + 8) * 300 - 901] = h__[j - 1 + (l + 4) * 300 - 
			901] * mat_ .a[i__ + (l + 6) * 700 - 2101] + h__[j - 
			1 + (l + 8) * 300 - 901] * mat_ .a[i__ + (l + 8) * 
			700 - 2101];
		g[j + (l + 2) * 300 - 901] = g[j - 1 + (l + 2) * 300 - 901] * 
			mat_ .a[n + (l + 2) * 700 - 2101] + g[j - 1 + (l + 6) 
			* 300 - 901] * mat_ .a[n + (l + 4) * 700 - 2101];
		g[j + (l + 4) * 300 - 901] = g[j - 1 + (l + 4) * 300 - 901] * 
			mat_ .a[n + (l + 2) * 700 - 2101] + g[j - 1 + (l + 8) 
			* 300 - 901] * mat_ .a[n + (l + 4) * 700 - 2101];
		g[j + (l + 6) * 300 - 901] = g[j - 1 + (l + 2) * 300 - 901] * 
			mat_ .a[n + (l + 6) * 700 - 2101] + g[j - 1 + (l + 6) 
			* 300 - 901] * mat_ .a[n + (l + 8) * 700 - 2101];
		g[j + (l + 8) * 300 - 901] = g[j - 1 + (l + 4) * 300 - 901] * 
			mat_ .a[n + (l + 6) * 700 - 2101] + g[j - 1 + (l + 8) 
			* 300 - 901] * mat_ .a[n + (l + 8) * 700 - 2101];
		h__[j + (l + 10) * 300 - 901] = h__[j - 1 + (l + 10) * 300 - 
			901] * mat_ .a[i__ + (l + 2) * 700 - 2101] + h__[j - 
			1 + (l + 12) * 300 - 901] * mat_ .a[i__ + (l + 4) * 
			700 - 2101] + mat_ .a[i__ + (l + 10) * 700 - 2101];
		h__[j + (l + 12) * 300 - 901] = h__[j - 1 + (l + 10) * 300 - 
			901] * mat_ .a[i__ + (l + 6) * 700 - 2101] + h__[j - 
			1 + (l + 12) * 300 - 901] * mat_ .a[i__ + (l + 8) * 
			700 - 2101] + mat_ .a[i__ + (l + 12) * 700 - 2101];
		g[j + (l + 10) * 300 - 901] = g[j - 1 + (l + 10) * 300 - 901] 
			* mat_ .a[n + (l + 2) * 700 - 2101] + g[j - 1 + (l + 
			12) * 300 - 901] * mat_ .a[n + (l + 4) * 700 - 2101] 
			+ mat_ .a[n + (l + 10) * 700 - 2101];
		g[j + (l + 12) * 300 - 901] = g[j - 1 + (l + 10) * 300 - 901] 
			* mat_ .a[n + (l + 6) * 700 - 2101] + g[j - 1 + (l + 
			12) * 300 - 901] * mat_ .a[n + (l + 8) * 700 - 2101] 
			+ mat_ .a[n + (l + 12) * 700 - 2101];
 
	    }
 
	}
L40:
	for (l = 1; l <= 2; ++l) {
	    for (m = 1; m <= 6; ++m) {
		mat_ .bl1[k + (l + (m << 1)) * 300 - 901] = h__[jm + (l + (m 
			<< 1)) * 300 - 901];
 
		mat_ .bl2[k + (l + (m << 1)) * 300 - 901] = g[jm + (l + (m << 
			1)) * 300 - 901];
	    }
	}
 
    }
    return 0;
}  

 
 
  int blockdis_(aeg, bl1eg, bl2eg)
doublereal *aeg, *bl1eg, *bl2eg;
{
     
    integer i__1, i__2;

     
    static doublereal g[3600]	 , h__[3600]	 
;
    static integer i__, j, k, l, m, n, jm;

 

 
 

 

     
    bl2eg -= 901;
    bl1eg -= 901;
    aeg -= 2101;

     
    i__1 = str_ .mblo;
    for (k = 1; k <= i__1; ++k) {
	jm = str2_ .mel[k - 1];
	i__ = str2_ .mtyp[k - 1];
	n = str2_ .mtyp[k + jm * 300 - 301];
	for (l = 1; l <= 2; ++l) {
	    for (m = 1; m <= 6; ++m) {
		h__[(l + (m << 1)) * 300 - 900] = aeg[i__ + (l + (m << 1)) * 
			700];
 
		g[(l + (m << 1)) * 300 - 900] = aeg[n + (l + (m << 1)) * 700];
	    }
	}
	if (jm == 1) {
	    goto L40;
	}
	i__2 = jm;
	for (j = 2; j <= i__2; ++j) {
	    i__ = str2_ .mtyp[k + j * 300 - 301];
	    n = str2_ .mtyp[k + (jm - j + 1) * 300 - 301];
	    for (l = 1; l <= 2; ++l) {
		h__[j + (l + 2) * 300 - 901] = h__[j - 1 + (l + 2) * 300 - 
			901] * aeg[i__ + (l + 2) * 700] + h__[j - 1 + (l + 6) 
			* 300 - 901] * aeg[i__ + (l + 4) * 700];
		h__[j + (l + 4) * 300 - 901] = h__[j - 1 + (l + 4) * 300 - 
			901] * aeg[i__ + (l + 2) * 700] + h__[j - 1 + (l + 8) 
			* 300 - 901] * aeg[i__ + (l + 4) * 700];
		h__[j + (l + 6) * 300 - 901] = h__[j - 1 + (l + 2) * 300 - 
			901] * aeg[i__ + (l + 6) * 700] + h__[j - 1 + (l + 6) 
			* 300 - 901] * aeg[i__ + (l + 8) * 700];
		h__[j + (l + 8) * 300 - 901] = h__[j - 1 + (l + 4) * 300 - 
			901] * aeg[i__ + (l + 6) * 700] + h__[j - 1 + (l + 8) 
			* 300 - 901] * aeg[i__ + (l + 8) * 700];
		g[j + (l + 2) * 300 - 901] = g[j - 1 + (l + 2) * 300 - 901] * 
			aeg[n + (l + 2) * 700] + g[j - 1 + (l + 6) * 300 - 
			901] * aeg[n + (l + 4) * 700];
		g[j + (l + 4) * 300 - 901] = g[j - 1 + (l + 4) * 300 - 901] * 
			aeg[n + (l + 2) * 700] + g[j - 1 + (l + 8) * 300 - 
			901] * aeg[n + (l + 4) * 700];
		g[j + (l + 6) * 300 - 901] = g[j - 1 + (l + 2) * 300 - 901] * 
			aeg[n + (l + 6) * 700] + g[j - 1 + (l + 6) * 300 - 
			901] * aeg[n + (l + 8) * 700];
		g[j + (l + 8) * 300 - 901] = g[j - 1 + (l + 4) * 300 - 901] * 
			aeg[n + (l + 6) * 700] + g[j - 1 + (l + 8) * 300 - 
			901] * aeg[n + (l + 8) * 700];
		h__[j + (l + 10) * 300 - 901] = h__[j - 1 + (l + 10) * 300 - 
			901] * aeg[i__ + (l + 2) * 700] + h__[j - 1 + (l + 12)
			 * 300 - 901] * aeg[i__ + (l + 4) * 700] + aeg[i__ + (
			l + 10) * 700];
		h__[j + (l + 12) * 300 - 901] = h__[j - 1 + (l + 10) * 300 - 
			901] * aeg[i__ + (l + 6) * 700] + h__[j - 1 + (l + 12)
			 * 300 - 901] * aeg[i__ + (l + 8) * 700] + aeg[i__ + (
			l + 12) * 700];
		g[j + (l + 10) * 300 - 901] = g[j - 1 + (l + 10) * 300 - 901] 
			* aeg[n + (l + 2) * 700] + g[j - 1 + (l + 12) * 300 - 
			901] * aeg[n + (l + 4) * 700] + aeg[n + (l + 10) * 
			700];
		g[j + (l + 12) * 300 - 901] = g[j - 1 + (l + 10) * 300 - 901] 
			* aeg[n + (l + 6) * 700] + g[j - 1 + (l + 12) * 300 - 
			901] * aeg[n + (l + 8) * 700] + aeg[n + (l + 12) * 
			700];
 
	    }
 
	}
L40:
	for (l = 1; l <= 2; ++l) {
	    for (m = 1; m <= 6; ++m) {
		bl1eg[k + (l + (m << 1)) * 300] = h__[jm + (l + (m << 1)) * 
			300 - 901];
 
		bl2eg[k + (l + (m << 1)) * 300] = g[jm + (l + (m << 1)) * 300 
			- 901];
	    }
	}
 
    }
    return 0;
}  

 
 
  int caconv_(a, b, c__)
doublereal *a, *b, *c__;
{
     
    double atan2();

 

    if ((( *b ) >= 0 ? ( *b ) : -( *b ))  > 1e-17 || (( *c__ ) >= 0 ? ( *c__ ) : -( *c__ ))  > 1e-17) {
	*a = atan2(*b, *c__);
    } else {
	*a = 0.;
    }
    return 0;
}  

 
 
  int calrms_(r__, m, rms, ptp)
doublereal *r__;
integer *m;
doublereal *rms, *ptp;
{
     
    integer i__1;

     
    double sqrt();

     
    static integer i__;
    static doublereal ave;
    static integer imin, imax;
    static doublereal xave, xrms;
    extern integer maxmin_();

 

 
 
 
 
 

 
     
    --r__;

     
    xave = (float)0.;
    xrms = (float)0.;
    i__1 = *m;
    for (i__ = 1; i__ <= i__1; ++i__) {
	xave += r__[i__];
	xrms += r__[i__] * r__[i__];
 
    }
    ave = xave / (real) (*m);
    *rms = xrms / (real) (*m);
    imax = maxmin_(&r__[1], m, &c__1);
    imin = maxmin_(&r__[1], m, &c__0);
    *ptp = r__[imax] - r__[imin];
    *rms = sqrt(*rms);
    return 0;
}  

 
 
  int chroma_()
{
     
    static char fmt_10010[] = "(\002 \002/131(\002-\002))";
    static char fmt_10020[] = "(//131(\002-\002)//t10,\002DATA BLOCK CHROMATICITY CORRECTION\002//t10,\002CHROMATICITIES         BEFORE           AFTER CORRECTION\002/t10,\002HORIZONTAL       \002,d16.10,7x,d16.10/t10,\002VERTICAL         \002,d16.10,7x,d16.10/)";
    static char fmt_10030[] = "(t10,\002SEXTUP.STRENGTHS \002,g16.10,7x,g16.10,\002   INDEX   \002,a16/t10,\002                 \002,g16.10,7x,g16.10,\002           \002,a16)";
    static char fmt_10040[] = "(t10,\002SEXTUPOLE SENSITIVITIES    XI/M1 XI/M2 ZI/M1 ZI/M2  \002,4d15.8)";
    static char fmt_10000[] = "(//131(\002-\002)//t10,\002CHROMATICITY CORRECTION\002//t10,\002MAXIMUM NUMBER OF ITERATIONS ACHIEVED--->\002,2x,i4/t10,\002PROCEDURE MAY NOT HAVE CONVERGED\002)";

     
    integer i__1;

     
    integer s_wsfe(), e_wsfe(), do_fio();

     
    static integer i__, j, l, n;
    static doublereal dm[2], xi[2], zi[2];
    static integer jj, ii;
    static doublereal ox, oz, de2, sm0[2], su2, dsm[8]	 , qwc[
	    3], cro0[2];
    static integer isl;
    static doublereal sens[8]	 , suxy, suzy, dpp, det;
    extern   int clorb_(), error_(), phasad_(), combel_();

     
    static cilist io___91 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___105 = { 0, 6, 0, fmt_10020, 0 };
    static cilist io___106 = { 0, 6, 0, fmt_10030, 0 };
    static cilist io___107 = { 0, 6, 0, fmt_10040, 0 };
    static cilist io___108 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___109 = { 0, 6, 0, fmt_10000, 0 };


 

 
 

 

    for (i__ = 1; i__ <= 2; ++i__) {
	for (j = 1; j <= 4; ++j) {
	    dsm[i__ + (j << 1) - 3] = 0.;
	    sens[i__ + (j << 1) - 3] = 0.;
 
	}
    }
    for (i__ = 1; i__ <= 2; ++i__) {
	xi[i__ - 1] = 0.;
	zi[i__ - 1] = 0.;
	dm[i__ - 1] = 0.;
	sm0[i__ - 1] = 0.;
	qwc[i__ - 1] = 0.;
	cro0[i__ - 1] = 0.;
 
    }
    qwc[2] = 0.;
    s_wsfe(&io___91);
    e_wsfe();
    dsm[2] = clo_ .dsm0;
    dsm[5] = clo_ .dsm0;
    de2 = clo_ .de0 * .5;
    i__1 = clo_ .itcro;
    for (jj = 1; jj <= i__1; ++jj) {
	for (ii = 1; ii <= 4; ++ii) {
	    su2 = 0.;
	    suxy = 0.;
	    suzy = 0.;
	    for (l = 1; l <= 2; ++l) {
		isl = (chrom_._1) .is[l - 1];
		if (ell_ .kz[isl - 1] != 3) {
		    error_(&c__11);
		}
		ell_ .ed[isl - 1] += dsm[l + (ii << 1) - 3];
		if (ell_ .kp[isl - 1] == 5) {
		    combel_(&isl);
		}
 
	    }
	    for (n = 1; n <= 5; ++n) {
		dpp = de2 * (3 - n);
		clorb_(&dpp);
		if (erro_ .ierro > 0) {
		    error_(&c__12);
		}
		phasad_(&dpp, qwc);
		if (erro_ .ierro > 0) {
		    error_(&c__13);
		}
		ox = qwc[0];
		oz = qwc[1];
		su2 += dpp * dpp;
		suxy += ox * dpp;
		suzy += oz * dpp;
 
	    }
	    for (l = 1; l <= 2; ++l) {
		isl = (chrom_._1) .is[l - 1];
		ell_ .ed[isl - 1] -= dsm[l + (ii << 1) - 3];
		if (ell_ .kp[isl - 1] == 5) {
		    combel_(&isl);
		}
 
	    }
	    sens[(ii << 1) - 2] = suxy / su2;
	    sens[(ii << 1) - 1] = suzy / su2;
	    if (ii != 3) {
		goto L80;
	    }
 
	    for (l = 1; l <= 2; ++l) {
		cro0[l - 1] = sens[l - 1] + (chrom_._1) .cro[l - 1];
		xi[l - 1] = (sens[(l + 1 << 1) - 2] - sens[0]) / clo_ .dsm0;
 
		zi[l - 1] = (sens[(l + 1 << 1) - 1] - sens[1]) / clo_ .dsm0;
	    }
	    det = xi[0] * zi[1] - zi[0] * xi[1];
	    dm[0] = (-cro0[0] * zi[1] + cro0[1] * xi[1]) / det;
	    dm[1] = (-cro0[1] * xi[0] + cro0[0] * zi[0]) / det;
	    for (l = 1; l <= 2; ++l) {
		sm0[l - 1] = ell_ .ed[(chrom_._1) .is[l - 1] - 1];
		isl = (chrom_._1) .is[l - 1];
		ell_ .ed[isl - 1] += dm[l - 1];
		if (ell_ .kp[isl - 1] == 5) {
		    combel_(&isl);
		}
 
	    }
L80:
	    ;
	}
	s_wsfe(&io___105);
	do_fio(&c__1, (char *)&sens[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&sens[6], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&sens[1], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&sens[7], (ftnlen)sizeof(doublereal));
	e_wsfe();
	s_wsfe(&io___106);
	do_fio(&c__1, (char *)&sm0[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& ell_ .ed[(chrom_._1) .is[0] - 1], (ftnlen)sizeof(
		doublereal));
	do_fio(&c__1, linopc_ .bez + ((chrom_._1) .is[0] - 1 << 4), 16L);
	do_fio(&c__1, (char *)&sm0[1], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& ell_ .ed[(chrom_._1) .is[1] - 1], (ftnlen)sizeof(
		doublereal));
	do_fio(&c__1, linopc_ .bez + ((chrom_._1) .is[1] - 1 << 4), 16L);
	e_wsfe();
	s_wsfe(&io___107);
	do_fio(&c__2, (char *)&xi[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__2, (char *)&zi[0], (ftnlen)sizeof(doublereal));
	e_wsfe();
	s_wsfe(&io___108);
	e_wsfe();
	if ((( sens[6] ) >= 0 ? ( sens[6] ) : -( sens[6] ))  < clo_ .dech && (( sens[7] ) >= 0 ? ( sens[7] ) : -( sens[7] ))  < clo_ .dech) {
	    return 0;
	}
 
    }
    s_wsfe(&io___109);
    do_fio(&c__1, (char *)& clo_ .itcro, (ftnlen)sizeof(integer));
    e_wsfe();
 

    return 0;
}  

 
 
  int cinvar_(a, b, c__, d__, j, e, xinv, invx)
doublereal *a, *b, *c__, *d__;
integer *j;
doublereal *e, *xinv;
integer *invx;
{
     
    doublereal d__1;

     
    static integer i__;

 

 

     
    --invx;
    --xinv;

     
    if ((( *a ) >= 0 ? ( *a ) : -( *a ))  <= *b) {
	for (i__ = 1; i__ <= 1000; ++i__) {
	    if (*c__ >= 0. && *c__ >= invari_ .dani[i__ - 1] && *c__ < 
		    invari_ .dani[i__] || *c__ < 0. && *d__ >= invari_ .dani[
		    i__ - 1] && *d__ < invari_ .dani[i__]) {
		++(*j);
		if ((d__1 = xinv[i__], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
		    xinv[i__] = *e;
		    invx[i__] = 1;
		} else {
		    xinv[i__] += *e;
		    ++invx[i__];
		}
	    }
 
	}
    }
    return 0;
}  

 
 
  int clor6_()
{
     
    static char fmt_10010[] = "(t5,/\002---- ENTRY CLOR6 ----\002/)";
    static char fmt_10020[] = "(t5,\002---- 6d closed orbit before correction----\002/t5,\002 CLOX \002,2g16.9,/t5,\002 CLOZ \002,2g16.9,/t5,\002 CLOS \002,2g16.9/)";
    static char fmt_10030[] = "(t5,\002---- after correction----\002/t5,\002 CLOX \002,2g16.9,/t5,\002 CLOZ \002,2g16.9,/t5,\002 CLOS \002,2g16.9,/t5,\002 ITERAT.=\002,i3,\002 ACCURACY=\002,d13.6//)";
    static char fmt_10000[] = "(t5/t10,\002CLOSED ORBIT CALCULATION\002/t10,\002MAXIMUM NUMBER OF ITERATIONS ACHIEVED--->\002,2x,i4/t10,\002PROCEDURE MAY NOT HAVE CONVERGED\002)";
    static char fmt_10040[] = "(t5,\002---- END CLOR6 ----\002/t5,\002 CLOX \002,2g16.9,/t5,\002  D-X \002,2g16.9,/t5,\002 CLOZ \002,2g16.9,/t5,\002  D-Z \002,2g16.9,/t5,\002 CLOS \002,2g16.9,/t5,\002  D-S \002,2g16.9,/t5,\002 ITERAT.=\002,i3,\002 ACCURACY=\002,d13.6/)";

     
    integer i__1;

     
    integer s_wsfe(), e_wsfe(), s_wsle(), do_lio(), e_wsle(), do_fio();
    double sqrt();

     
    static integer j, k, l;
    static doublereal x1[3], y1[3], dx[3], dy[3];
    static integer ii, jj, kk, ind[6];
    static doublereal dcx, dclo[3], dclop[3];
    extern   int dinv_();
    static doublereal dcxp, dcy, dcyp, dcz, dczp, cor;
    extern   int umlau6_();
    static integer nerror, iqmod6o;

     
    static cilist io___111 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___117 = { 0, 6, 0, 0, 0 };
    static cilist io___134 = { 0, 6, 0, fmt_10020, 0 };
    static cilist io___136 = { 0, 6, 0, fmt_10030, 0 };
    static cilist io___137 = { 0, 6, 0, fmt_10000, 0 };
    static cilist io___138 = { 0, 6, 0, fmt_10020, 0 };
    static cilist io___139 = { 0, 6, 0, fmt_10030, 0 };
    static cilist io___140 = { 0, 6, 0, 0, 0 };
    static cilist io___141 = { 0, 6, 0, fmt_10040, 0 };


 

 
 

 

    s_wsfe(&io___111);
    e_wsfe();
    sixdim_ .mapout = 0;
    iqmod6o = qmodi_ .iqmod6;
    qmodi_ .iqmod6 = 0;
    dial_ .idalloc = 1;
    i__1 = clo_ .itco;
    for (ii = 1; ii <= i__1; ++ii) {
	for (l = 1; l <= 2; ++l) {
	    (tra_._1) .x[l * 6 - 6] = co6d_ .clo6[l - 1];
	    (tra_._1) .y[l * 6 - 6] = co6d_ .clop6[l - 1];
 
	}
	syos_ .sigm[0] = co6d_ .clo6[2];
	syos_ .dps[0] = co6d_ .clop6[2];
	if (ii == clo_ .itco) {
	    dial_ .idalloc = 2;
	    if (iqmod6o == 0) {
		sixdim_ .mapout = 1;
	    }
	}
	umlau6_();
	dinv_(&c__6, sixdim_ .aml6, &c__6, ind, &nerror);
	if (nerror != 0) {
	    s_wsle(&io___117);
	    do_lio(&c__9, &c__1, " ATTENTION, MATRIX SINGULAR ", 28L);
	    e_wsle();
	}
	for (l = 1; l <= 2; ++l) {
	    x1[l - 1] = (tra_._1) .x[l * 6 - 6];
	    y1[l - 1] = (tra_._1) .y[l * 6 - 6];
 
	}
	x1[2] = syos_ .sigm[0];
	y1[2] = syos_ .dps[0];
	for (l = 1; l <= 3; ++l) {
	    dx[l - 1] = co6d_ .clo6[l - 1] - x1[l - 1];
	    dy[l - 1] = co6d_ .clop6[l - 1] - y1[l - 1];
 
	}
	dcx = (( dx[0] ) >= 0 ? ( dx[0] ) : -( dx[0] )) ;
	dcxp = (( dy[0] ) >= 0 ? ( dy[0] ) : -( dy[0] )) ;
	dcy = (( dx[1] ) >= 0 ? ( dx[1] ) : -( dx[1] )) ;
	dcyp = (( dy[1] ) >= 0 ? ( dy[1] ) : -( dy[1] )) ;
	dcz = (( dx[2] ) >= 0 ? ( dx[2] ) : -( dx[2] ))  * .01;
	dczp = (( dy[2] ) >= 0 ? ( dy[2] ) : -( dy[2] )) ;
	if (dcx <= clo_ .dma && dcz <= clo_ .dma && dcxp <= clo_ .dmap && 
		dczp <= clo_ .dmap && dcy <= clo_ .dma && dcyp <= clo_ .dmap) 
		{
	    goto L90;
	}
	for (k = 1; k <= 3; ++k) {
	    dclo[k - 1] = 0.;
	    dclop[k - 1] = 0.;
	    for (j = 1; j <= 3; ++j) {
		jj = j << 1;
		kk = k << 1;
		dclo[k - 1] = sixdim_ .aml6[kk - 1 + (jj - 1) * 6 - 7] * dx[j 
			- 1] + dclo[k - 1];
		dclo[k - 1] = sixdim_ .aml6[kk - 1 + jj * 6 - 7] * dy[j - 1] 
			+ dclo[k - 1];
		dclop[k - 1] = sixdim_ .aml6[kk + (jj - 1) * 6 - 7] * dx[j - 
			1] + dclop[k - 1];
		dclop[k - 1] = sixdim_ .aml6[kk + jj * 6 - 7] * dy[j - 1] + 
			dclop[k - 1];
 
	    }
 
	}
	s_wsfe(&io___134);
	do_fio(&c__1, (char *)& co6d_ .clo6[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& co6d_ .clop6[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& co6d_ .clo6[1], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& co6d_ .clop6[1], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& co6d_ .clo6[2], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& co6d_ .clop6[2], (ftnlen)sizeof(doublereal));
	e_wsfe();
	for (l = 1; l <= 3; ++l) {
	    co6d_ .clo6[l - 1] += dclo[l - 1];
	    co6d_ .clop6[l - 1] += dclop[l - 1];
 
	}
	cor = sqrt(dcx * dcx + dcy * dcy + dcz * dcz);
	if (ii != clo_ .itco) {
	    s_wsfe(&io___136);
	    do_fio(&c__1, (char *)& co6d_ .clo6[0], (ftnlen)sizeof(doublereal))
		    ;
	    do_fio(&c__1, (char *)& co6d_ .clop6[0], (ftnlen)sizeof(doublereal)
		    );
	    do_fio(&c__1, (char *)& co6d_ .clo6[1], (ftnlen)sizeof(doublereal))
		    ;
	    do_fio(&c__1, (char *)& co6d_ .clop6[1], (ftnlen)sizeof(doublereal)
		    );
	    do_fio(&c__1, (char *)& co6d_ .clo6[2], (ftnlen)sizeof(doublereal))
		    ;
	    do_fio(&c__1, (char *)& co6d_ .clop6[2], (ftnlen)sizeof(doublereal)
		    );
	    do_fio(&c__1, (char *)&ii, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&cor, (ftnlen)sizeof(doublereal));
	    e_wsfe();
	}
 
    }
    s_wsfe(&io___137);
    do_fio(&c__1, (char *)& clo_ .itco, (ftnlen)sizeof(integer));
    e_wsfe();
    ii = clo_ .itco;
L90:
    if (ii != clo_ .itco) {
	for (k = 1; k <= 3; ++k) {
	    dclo[k - 1] = 0.;
	    dclop[k - 1] = 0.;
	    for (j = 1; j <= 3; ++j) {
		jj = j << 1;
		kk = k << 1;
		dclo[k - 1] = sixdim_ .aml6[kk - 1 + (jj - 1) * 6 - 7] * dx[j 
			- 1] + dclo[k - 1];
		dclo[k - 1] = sixdim_ .aml6[kk - 1 + jj * 6 - 7] * dy[j - 1] 
			+ dclo[k - 1];
		dclop[k - 1] = sixdim_ .aml6[kk + (jj - 1) * 6 - 7] * dx[j - 
			1] + dclop[k - 1];
		dclop[k - 1] = sixdim_ .aml6[kk + jj * 6 - 7] * dy[j - 1] + 
			dclop[k - 1];
 
	    }
 
	}
	s_wsfe(&io___138);
	do_fio(&c__1, (char *)& co6d_ .clo6[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& co6d_ .clop6[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& co6d_ .clo6[1], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& co6d_ .clop6[1], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& co6d_ .clo6[2], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& co6d_ .clop6[2], (ftnlen)sizeof(doublereal));
	e_wsfe();
	for (l = 1; l <= 3; ++l) {
	    co6d_ .clo6[l - 1] += dclo[l - 1];
	    co6d_ .clop6[l - 1] += dclop[l - 1];
 
	}
	cor = sqrt(dcx * dcx + dcy * dcy + dcz * dcz);
	s_wsfe(&io___139);
	do_fio(&c__1, (char *)& co6d_ .clo6[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& co6d_ .clop6[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& co6d_ .clo6[1], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& co6d_ .clop6[1], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& co6d_ .clo6[2], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& co6d_ .clop6[2], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&ii, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)&cor, (ftnlen)sizeof(doublereal));
	e_wsfe();
	for (l = 1; l <= 2; ++l) {
	    (tra_._1) .x[l * 6 - 6] = co6d_ .clo6[l - 1];
	    (tra_._1) .y[l * 6 - 6] = co6d_ .clop6[l - 1];
 
	}
	syos_ .sigm[0] = co6d_ .clo6[2];
	syos_ .dps[0] = co6d_ .clop6[2];
	dial_ .idalloc = 2;
	if (iqmod6o == 0) {
	    sixdim_ .mapout = 1;
	}
	umlau6_();
	dinv_(&c__6, sixdim_ .aml6, &c__6, ind, &nerror);
	if (nerror != 0) {
	    s_wsle(&io___140);
	    do_lio(&c__9, &c__1, " ATTENTION, MATRIX SINGULAR ", 28L);
	    e_wsle();
	}
	for (l = 1; l <= 2; ++l) {
	    x1[l - 1] = (tra_._1) .x[l * 6 - 6];
	    y1[l - 1] = (tra_._1) .y[l * 6 - 6];
 
	}
	x1[2] = syos_ .sigm[0];
	y1[2] = syos_ .dps[0];
	for (l = 1; l <= 3; ++l) {
	    dx[l - 1] = co6d_ .clo6[l - 1] - x1[l - 1];
	    dy[l - 1] = co6d_ .clop6[l - 1] - y1[l - 1];
 
	}
	dcx = (( dx[0] ) >= 0 ? ( dx[0] ) : -( dx[0] )) ;
	dcxp = (( dy[0] ) >= 0 ? ( dy[0] ) : -( dy[0] )) ;
	dcy = (( dx[1] ) >= 0 ? ( dx[1] ) : -( dx[1] )) ;
	dcyp = (( dy[1] ) >= 0 ? ( dy[1] ) : -( dy[1] )) ;
	dcz = (( dx[2] ) >= 0 ? ( dx[2] ) : -( dx[2] ))  * .01;
	dczp = (( dy[2] ) >= 0 ? ( dy[2] ) : -( dy[2] )) ;
    }
    qmodi_ .iqmod6 = iqmod6o;
    cor = sqrt(dcx * dcx + dcy * dcy + dcz * dcz);
    s_wsfe(&io___141);
    do_fio(&c__1, (char *)& co6d_ .clo6[0], (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)& co6d_ .clop6[0], (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)&dcx, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)&dcxp, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)& co6d_ .clo6[1], (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)& co6d_ .clop6[1], (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)&dcy, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)&dcyp, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)& co6d_ .clo6[2], (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)& co6d_ .clop6[2], (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)&dcz, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)&dczp, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)&ii, (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)&cor, (ftnlen)sizeof(doublereal));
    e_wsfe();
    syos_ .dps[0] = syos_ .dps[0];
 

    return 0;
}  

 
 
  int clorb_(dpp)
doublereal *dpp;
{
     
    static char fmt_10000[] = "(t5/t10,\002CLOSED ORBIT CALCULATION\002/t10,\002MAXIMUM NUMBER OF ITERATIONS ACHIEVED--->\002,2x,i4/t10,\002PROCEDURE MAY NOT HAVE CONVERGED\002)";
    static char fmt_10010[] = "(t5,\002---- ENTRY CLORB ----/DPP=\002,f8.5,\002 /CLOX/\002,2f10.5,\002 /CLOZ/\002,2f10.5,\002 /ITERAT.=\002,i3,\002/ ACCURACY=\002,d13.6)";

     
    integer i__1;

     
    integer s_wsfe(), do_fio(), e_wsfe();
    double sqrt();

     
    static integer l;
    static doublereal x0[2], x1[2], y1[2], y0[2], am[16]	 
, dx[2], dy[2];
    static integer ii, ll;
    static doublereal dcx, dcz, dclo[2];
    static integer ierr;
    static doublereal dcxp, dczp, det, cor, dclop[2];
    extern   int envar_(), umlauf_(), matrix_();

     
    static cilist io___160 = { 0, 6, 0, fmt_10000, 0 };
    static cilist io___162 = { 0, 6, 0, fmt_10010, 0 };


 

 
 

 

    erro_ .ierro = 0;
    for (l = 1; l <= 2; ++l) {
	(tra_._1) .clo[l - 1] = *dpp * beo_ .di0[l - 1];
	(tra_._1) .clop[l - 1] = *dpp * beo_ .dip0[l - 1];
	dx[l - 1] = (float)1e6;
	dy[l - 1] = (float)1e6;
 
    }
    envar_(dpp);
    umlauf_(dpp, &c__1, &ierr);
    erro_ .ierro = ierr;
    if (erro_ .ierro != 0) {
	return 0;
    }
    i__1 = clo_ .itco;
    for (ii = 1; ii <= i__1; ++ii) {
	dcx = (( dx[0] ) >= 0 ? ( dx[0] ) : -( dx[0] )) ;
	dcxp = (( dy[0] ) >= 0 ? ( dy[0] ) : -( dy[0] )) ;
	dcz = (( dx[1] ) >= 0 ? ( dx[1] ) : -( dx[1] )) ;
	dczp = (( dy[1] ) >= 0 ? ( dy[1] ) : -( dy[1] )) ;
	if (dcx <= clo_ .dma && dcz <= clo_ .dma && dcxp <= clo_ .dmap && 
		dczp <= clo_ .dmap) {
	    goto L50;
	}
	for (l = 1; l <= 2; ++l) {
	    (tra_._1) .x[l * 6 - 6] = (tra_._1) .clo[l - 1];
	    (tra_._1) .y[l * 6 - 6] = (tra_._1) .clop[l - 1];
	    x0[l - 1] = (tra_._1) .x[l * 6 - 6];
 
	    y0[l - 1] = (tra_._1) .y[l * 6 - 6];
	}
	matrix_(dpp, am);
	if (erro_ .ierro != 0) {
	    return 0;
	}
	for (l = 1; l <= 2; ++l) {
	    ll = l << 1;
	    x1[l - 1] = (tra_._1) .x[l * 6 - 6];
	    y1[l - 1] = (tra_._1) .y[l * 6 - 6];
	    det = 2. - am[ll - 1 + (ll - 1 << 2) - 5] - am[ll + (ll << 2) - 5]
		    ;
	    dx[l - 1] = x0[l - 1] - x1[l - 1];
	    dy[l - 1] = y0[l - 1] - y1[l - 1];
	    dclo[l - 1] = (dx[l - 1] * (am[ll + (ll << 2) - 5] - 1.) - dy[l - 
		    1] * am[ll - 1 + (ll << 2) - 5]) / det;
	    dclop[l - 1] = (dy[l - 1] * (am[ll - 1 + (ll - 1 << 2) - 5] - 1.) 
		    - dx[l - 1] * am[ll + (ll - 1 << 2) - 5]) / det;
	    (tra_._1) .clo[l - 1] += dclo[l - 1];
	    (tra_._1) .clop[l - 1] += dclop[l - 1];
 
	}
 
    }
    if (clos_ .ncorru != 1) {
	s_wsfe(&io___160);
	do_fio(&c__1, (char *)& clo_ .itco, (ftnlen)sizeof(integer));
	e_wsfe();
    }
L50:
    cor = sqrt(dcx * dcx + dcz * dcz);
    if (clo_ .iout == 1 && clos_ .ncorru != 1) {
	s_wsfe(&io___162);
	do_fio(&c__1, (char *)&(*dpp), (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& (tra_._1) .clo[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& (tra_._1) .clop[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& (tra_._1) .clo[1], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& (tra_._1) .clop[1], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&ii, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)&cor, (ftnlen)sizeof(doublereal));
	e_wsfe();
    }
 

    return 0;
}  

 
 
  int clorb2_(dpp)
doublereal *dpp;
{
     
    integer i__1;

     
    static integer l;
    static doublereal x0[2], x1[2], y1[2], y0[2], am[16]	 
, dx[2], dy[2];
    static integer ii, ll;
    static doublereal dcx, dcz, dclo[2];
    static integer ierr;
    static doublereal dcxp, dczp, det, dclop[2];
    extern   int envar_(), error_(), umlauf_(), matrix_();

 

 
 

 

    erro_ .ierro = 0;
    for (l = 1; l <= 2; ++l) {
	(tra_._1) .clo[l - 1] = *dpp * beo_ .di0[l - 1];
	(tra_._1) .clop[l - 1] = *dpp * beo_ .dip0[l - 1];
	dx[l - 1] = (float)1e6;
	dy[l - 1] = (float)1e6;
 
    }
    envar_(dpp);
    umlauf_(dpp, &c__1, &ierr);
    erro_ .ierro = ierr;
    if (erro_ .ierro != 0) {
	error_(&c__36);
    }
    i__1 = clo_ .itco;
    for (ii = 1; ii <= i__1; ++ii) {
	dcx = (( dx[0] ) >= 0 ? ( dx[0] ) : -( dx[0] )) ;
	dcxp = (( dy[0] ) >= 0 ? ( dy[0] ) : -( dy[0] )) ;
	dcz = (( dx[1] ) >= 0 ? ( dx[1] ) : -( dx[1] )) ;
	dczp = (( dy[1] ) >= 0 ? ( dy[1] ) : -( dy[1] )) ;
	if (dcx <= clo_ .dma && dcz <= clo_ .dma && dcxp <= clo_ .dmap && 
		dczp <= clo_ .dmap) {
	    return 0;
	}
	for (l = 1; l <= 2; ++l) {
	    (tra_._1) .x[l * 6 - 6] = (tra_._1) .clo[l - 1];
	    (tra_._1) .y[l * 6 - 6] = (tra_._1) .clop[l - 1];
	    x0[l - 1] = (tra_._1) .x[l * 6 - 6];
 
	    y0[l - 1] = (tra_._1) .y[l * 6 - 6];
	}
	matrix_(dpp, am);
	if (erro_ .ierro != 0) {
	    error_(&c__36);
	}
	for (l = 1; l <= 2; ++l) {
	    ll = l << 1;
	    x1[l - 1] = (tra_._1) .x[l * 6 - 6];
	    y1[l - 1] = (tra_._1) .y[l * 6 - 6];
	    det = 2. - am[ll - 1 + (ll - 1 << 2) - 5] - am[ll + (ll << 2) - 5]
		    ;
	    dx[l - 1] = x0[l - 1] - x1[l - 1];
	    dy[l - 1] = y0[l - 1] - y1[l - 1];
	    dclo[l - 1] = (dx[l - 1] * (am[ll + (ll << 2) - 5] - 1.) - dy[l - 
		    1] * am[ll - 1 + (ll << 2) - 5]) / det;
	    dclop[l - 1] = (dy[l - 1] * (am[ll - 1 + (ll - 1 << 2) - 5] - 1.) 
		    - dx[l - 1] * am[ll + (ll - 1 << 2) - 5]) / det;
	    (tra_._1) .clo[l - 1] += dclo[l - 1];
	    (tra_._1) .clop[l - 1] += dclop[l - 1];
 
	}
 
    }
 

    return 0;
}  

 
 
  int combel_(iql)
integer *iql;
{
     
    integer i__1;
    doublereal d__1;

     
    static integer j, m, ico0, ico;
    extern   int error_();

 

 
 

 

    i__1 = combin_ .icoe;
    for (j = 1; j <= i__1; ++j) {
	ico0 = combin_ .icomb0[j - 1];
	if (*iql != ico0) {
	    goto L20;
	}
	for (m = 1; m <= 20; ++m) {
	    ico = combin_ .icomb[j + m * 100 - 101];
	    if (ico == 0) {
		goto L10;
	    }
	    if (ell_ .kz[ico0 - 1] != ell_ .kz[ico - 1]) {
		error_(&c__14);
	    }
	    if ((d__1 = ell_ .el[ico0 - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		if ((d__1 = ell_ .el[ico - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		    ell_ .ek[ico - 1] = ell_ .ek[ico0 - 1] * combin_ .ratio[j 
			    + m * 100 - 101];
		} else {
		    ell_ .ed[ico - 1] = ell_ .ek[ico0 - 1] * combin_ .ratio[j 
			    + m * 100 - 101];
		}
	    }
	    if ((d__1 = ell_ .el[ico0 - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
		if ((d__1 = ell_ .el[ico - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
		    ell_ .ed[ico - 1] = ell_ .ed[ico0 - 1] * combin_ .ratio[j 
			    + m * 100 - 101];
		} else {
		    ell_ .ek[ico - 1] = ell_ .ed[ico0 - 1] * combin_ .ratio[j 
			    + m * 100 - 101];
		}
	    }
L10:
	    ;
	}
L20:
	;
    }
 

    return 0;
}  

 
 
  int comnul_()
{
     
      int s_copy();

     
    static integer i__, j, i1, i2, i3, i4;

 

 
 

 

    clos_ .ncorru = 0;
    clos_ .ncorrep = 0;
    ripp2_ .nrturn = 0;
    tit_ .ithick = 0;
    erro_ .ierro = 0;
    str_ .il = 0;
    tra1_ .iclo6 = 0;
    tra1_ .iclo6r = 0;
    str_ .mper = 0;
    str_ .mblo = 0;
    str_ .mbloz = 0;
    str_ .kanf = 0;
    str_ .iu = 0;
    anf_ .itra = 0;
    tra1_ .napx = 0;
    tra1_ .numl = 0;
    tra1_ .numlr = 0;
    tra1_ .ird = 0;
    tra1_ .imc = 0;
    syn_ .idp = 0;
    tra1_ .irew = 0;
    rand0_ .iorg = 0;
    clo_ .itco = 0;
    clo_ .itcro = 0;
    clo_ .itqv = 0;
    (chrom_._1) .ichrom = 0;
    qmodi_ .iqmod = 0;
    linop_ .ilin = 0;
    linop_ .ntco = 0;
    linop_ .nt = 0;
    linop_ .iprint = 0;
    clos_ .iclo = 0;
    combin_ .icoe = 0;
    sea_ .ise = 0;
    sea_ .mesa = 0;
    sea_ .mp = 0;
    sea_ .m21 = 0;
    sea_ .m22 = 0;
    sea_ .m23 = 0;
    sea_ .ise1 = 0;
    sea_ .ise2 = 0;
    sea_ .ise3 = 0;
    subres_ .isub = 0;
    subres_ .nta = 0;
    subres_ .nte = 0;
    subres_ .ipt = 0;
    secom_ .irmod2 = 0;
    secom1_ .nre = 0;
    secom1_ .nur = 0;
    secom1_ .nch = 0;
    secom1_ .nqc = 0;
    secom1_ .npp = 0;
    posti1_ .ipos = 0;
    postr_ .iconv = 0;
    postr_ .imad = 0;
    postr_ .iskip = 1;
    posti1_ .iav = 0;
    posti1_ .iwg = 0;
    posti1_ .ivox = 0;
    posti1_ .ivoz = 0;
    posti1_ .ires = 0;
    posti1_ .ifh = 0;
    posti2_ .kwtype = 0;
    posti2_ .itf = 0;
    posti2_ .icr = 0;
    posti2_ .idis = 0;
    posti2_ .icow = 0;
    posti2_ .istw = 0;
    posti2_ .iffw = 0;
    ripp_ .irip = 0;
    ripp_ .irco = 0;
    dial_ .idial = 0;
    dial_ .nord = 0;
    dial_ .nvar = 0;
    beam_ .nbeam = 0;
    beam_ .ibeco = 0;
    tra1_ .iver = 0;
    tra1_ .ibidu = 0;
 

    norf_ .inorm = 0;
    norf_ .imod1 = 0;
    norf_ .imod2 = 0;
    norf_ .nordf = 0;
    norf_ .nvarf = 0;
 

    tcorr_ .icorr = 0;
    tcorr_ .nctype = 0;
    tcorr_ .namp = 0;
    tcorr_ .nmom = 0;
    tcorr_ .nmom1 = 0;
    tcorr_ .nmom2 = 0;
    tcorr_ .weig1 = 0.;
    tcorr_ .weig2 = 0.;
    tcorr_ .dpmax = 0.;
 

    kons_ .pi = 0.;
    kons_ .pi2 = 0.;
    kons_ .pisqrt = 0.;
    kons_ .rad = 0.;
    anf_ .chi0 = 0.;
    anf_ .chid = 0.;
    anf_ .dp1 = 0.;
    tra1_ .idfor = 0;
    tra1_ .rat = 0.;
    syn_ .qs = 0.;
    syn_ .e0 = 0.;
    syn_ .pma = 0.;
    syn_ .phas0 = 0.;
    syn_ .phas = 0.;
    syn_ .ition = 0;
    cor_ .dpscor = 1.;
    cor_ .sigcor = 1.;
    mult1_ .benki = 0.;
    clo_ .dma = 0.;
    clo_ .dmap = 0.;
    clo_ .dkq = 0.;
    clo_ .dqq = 0.;
    clo_ .de0 = 0.;
    clo_ .ded = 0.;
    clo_ .dsi = 0.;
    clo_ .dech = 0.;
    clo_ .dsm0 = 0.;
    qmodi_ .amp0 = 0.;
    subres_ .qxt = 0.;
    subres_ .qzt = 0.;
    linop_ .eui = 0.;
    linop_ .euii = 0.;
    subres_ .tam1 = 0.;
    subres_ .tam2 = 0.;
    subres_ .totl = 0.;
    postr_ .nstart = 0;
    postr_ .nstop = 0;
    postr_ .dphix = 0.;
    postr_ .dphiz = 0.;
    postr_ .qx0 = 0.;
    postr_ .qz0 = 0.;
    postr_ .dres = 0.;
    postr_ .dfft = 0.;
    dial_ .preda = 0.;
    beam_ .partnum = 0.;
    beam_ .emitnx = 0.;
    beam_ .emitnz = 0.;
    beam_ .gammar = 0.;
 

    for (i__ = 1; i__ <= 2; ++i__) {
	tra1_ .nde[i__ - 1] = 0;
	(chrom_._1) .is[i__ - 1] = 0;
	syos_ .idz[i__ - 1] = 0;
	(tra_._1) .amp[i__ - 1] = 0.;
	(tra_._1) .bet0[i__ - 1] = 0.;
	(tra_._1) .alf0[i__ - 1] = 0.;
	(tra_._1) .clo[i__ - 1] = 0.;
	(tra_._1) .clop[i__ - 1] = 0.;
	beo_ .aper[i__ - 1] = 1e3;
	beo_ .di0[i__ - 1] = 0.;
	beo_ .dip0[i__ - 1] = 0.;
	(chrom_._1) .cro[i__ - 1] = 0.;
	clos_ .sigma0[i__ - 1] = 0.;
	skew_ .qwsk[i__ - 1] = 0.;
	skew_ .betx[i__ - 1] = 0.;
	skew_ .betz[i__ - 1] = 0.;
	skew_ .alfx[i__ - 1] = 0.;
	skew_ .alfz[i__ - 1] = 0.;
 
    }
    for (i__ = 1; i__ <= 3; ++i__) {
	qmodi_ .iq[i__ - 1] = 0;
	syn_ .hsy[i__ - 1] = 0.;
	qmodi_ .qw0[i__ - 1] = 0.;
	co6d_ .clo6[i__ - 1] = 0.;
	co6d_ .clop6[i__ - 1] = 0.;
 
    }
    for (i__ = 1; i__ <= 4; ++i__) {
	tra1_ .nwr[i__ - 1] = 0;
 
    }
    for (i__ = 1; i__ <= 5; ++i__) {
	secom_ .ipr[i__ - 1] = 0;
	secom1_ .nrr[i__ - 1] = 0;
	secom1_ .nu[i__ - 1] = 0;
	s_copy(posti3_ .toptit + (i__ - 1) * 80, " ", 80L, 1L);
 
    }
    for (i__ = 1; i__ <= 6; ++i__) {
	skew_ .nskew[i__ - 1] = 0;
 
    }
    for (i__ = 1; i__ <= 10; ++i__) {
	secom1_ .dtr[i__ - 1] = 0.;
	s_copy(tcorrc_ .coel + (i__ - 1 << 4), " ", 16L, 1L);
 
    }
    for (i__ = 1; i__ <= 12; ++i__) {
	secom_ .ire[i__ - 1] = 0;
 
    }
    for (i__ = 1; i__ <= 16; ++i__) {
	str_ .msym[i__ - 1] = 0;
 
    }
    for (i__ = 1; i__ <= 6; ++i__) {
	for (j = 1; j <= 6; ++j) {
	    beo_ .ta[i__ + j * 6 - 7] = 0.;
 
	}
    }
    for (i__ = 1; i__ <= 2; ++i__) {
	for (j = 1; j <= 6; ++j) {
	    anf_ .exz[i__ + (j << 1) - 3] = 0.;
 
	}
    }
    for (i1 = 1; i1 <= 9; ++i1) {
	for (i2 = 1; i2 <= 18; ++i2) {
	    for (i3 = 1; i3 <= 10; ++i3) {
		for (i4 = 1; i4 <= 5; ++i4) {
		    secom_ .rtc[i1 + (i2 + (i3 + i4 * 10) * 18) * 9 - 1792] = 
			    0.;
		    secom_ .rts[i1 + (i2 + (i3 + i4 * 10) * 18) * 9 - 1792] = 
			    0.;
 
		}
	    }
	}
    }
 

    for (i__ = 1; i__ <= 700; ++i__) {
	ell_ .kz[i__ - 1] = 0;
	ell_ .kp[i__ - 1] = 0;
	mult1_ .irm[i__ - 1] = 0;
	mult1_ .nmu[i__ - 1] = 0;
	qmodi_ .kpa[i__ - 1] = 0;
	sea_ .isea[i__ - 1] = 0;
	ripp_ .nrel[i__ - 1] = 0;
	cororb_ .ncororb[i__ - 1] = 0;
	combin_ .iratioe[i__ - 1] = 0;
	syn_ .itionc[i__ - 1] = 0;
	dkic_ .dki[i__ - 1] = 0.;
	dkic_ .dki[i__ + 699] = 0.;
	dkic_ .dki[i__ + 1399] = 0.;
	ell_ .ed[i__ - 1] = 0.;
	ell_ .el[i__ - 1] = 0.;
	ell_ .ek[i__ - 1] = 0.;
	ell_ .sm[i__ - 1] = 0.;
	pla_ .xpl[i__ - 1] = 0.;
	pla_ .xrms[i__ - 1] = 0.;
	pla_ .zpl[i__ - 1] = 0.;
	pla_ .zrms[i__ - 1] = 0.;
	mult1_ .benkc[i__ - 1] = 0.;
	mult1_ .r00[i__ - 1] = 0.;
	apert_ .apx[i__ - 1] = 1e3;
	apert_ .apz[i__ - 1] = 1e3;
	ripp_ .ramp[i__ - 1] = 0.;
	ripp_ .rfre[i__ - 1] = 0.;
	ripp_ .rzph[i__ - 1] = 0.;
	combin_ .ratioe[i__ - 1] = 1.;
	syn_ .hsyc[i__ - 1] = 0.;
	syn_ .phasc[i__ - 1] = 0.;
	s_copy(linopc_ .bez + (i__ - 1 << 4), " ", 16L, 1L);
	s_copy(linopc_ .bezl + (i__ - 1 << 4), " ", 16L, 1L);
	for (i3 = 1; i3 <= 2; ++i3) {
	    beam_ .sigman6[i3 + (i__ << 1) - 3] = 0.;
	    for (i4 = 1; i4 <= 6; ++i4) {
		mat_ .a[i__ + (i3 + (i4 << 1)) * 700 - 2101] = 0.;
		for (i1 = 1; i1 <= 64; ++i1) {
		    syos_ .al[i4 + (i3 + (i1 + (i__ << 6) << 1)) * 6 - 787] = 
			    0.;
		    beam_ .sigman[i3 + (i1 + (i__ << 6) << 1) - 131] = 0.;
		    beam_ .sigman2[i3 + (i1 + (i__ << 6) << 1) - 131] = 0.;
		    beam_ .sigmanq[i3 + (i1 + (i__ << 6) << 1) - 131] = 0.;
		    beam_ .clobeam[i3 + (i1 + (i__ << 6) << 1) - 131] = 0.;
		    beam_ .beamoff[i3 + (i1 + (i__ << 6) << 1) - 131] = 0.;
 
		}
	    }
	}
	for (i1 = 1; i1 <= 11; ++i1) {
	    multi_ .bk0[i__ + i1 * 700 - 701] = 0.;
	    multi_ .ak0[i__ + i1 * 700 - 701] = 0.;
	    multi_ .bka[i__ + i1 * 700 - 701] = 0.;
	    multi_ .aka[i__ + i1 * 700 - 701] = 0.;
 
	}
	for (i1 = 1; i1 <= 3; ++i1) {
	    s_copy(rand0c_ .bezr + (i1 + i__ * 3 - 4 << 4), " ", 16L, 1L);
 
	}
 
    }
 

    for (i__ = 1; i__ <= 300; ++i__) {
	str2_ .mel[i__ - 1] = 0;
	str2_ .mstr[i__ - 1] = 0;
	linop_ .elbe[i__ - 1] = 0.;
	s_copy(linopc_ .bezb + (i__ - 1 << 4), " ", 16L, 1L);
	for (i1 = 1; i1 <= 2; ++i1) {
	    for (i2 = 1; i2 <= 6; ++i2) {
		mat_ .bl1[i__ + (i1 + (i2 << 1)) * 300 - 901] = 0.;
		mat_ .bl2[i__ + (i1 + (i2 << 1)) * 300 - 901] = 0.;
 
	    }
	}
	for (j = 1; j <= 100; ++j) {
	    str2_ .mtyp[i__ + j * 300 - 301] = 0;
 
	}
 
    }
 

    for (i__ = 1; i__ <= 20000; ++i__) {
	str_ .ic[i__ - 1] = 0;
	rand0_ .mzu[i__ - 1] = 0;
	rand1_ .icext[i__ - 1] = 0;
	rand1_ .icextal[i__ - 1] = 0;
	rand1_ .extalign[i__ - 1] = 0.;
	rand1_ .extalign[i__ + 19999] = 0.;
	rand1_ .extalign[i__ + 39999] = 0.;
	syn_ .sigmoff[i__ - 1] = 0.;
	rand1_ .tiltc[i__ - 1] = 1.;
	rand1_ .tilts[i__ - 1] = 0.;
	for (j = 1; j <= 40; ++j) {
	    rand1_ .exterr[i__ + j * 20000 - 20001] = 0.;
 
	}
    }
 

    for (i__ = 1; i__ <= 300000; ++i__) {
	rand0_ .zfz[i__ - 1] = 0.;
 
    }
 

    for (i__ = 1; i__ <= 6; ++i__) {
	syos2_ .rvf[i__ - 1] = 1.;
	syos_ .sigm[i__ - 1] = 0.;
	syos_ .dps[i__ - 1] = 0.;
	syn_ .ej[i__ - 1] = 0.;
	syn_ .ejf[i__ - 1] = 0.;
	for (i1 = 1; i1 <= 2; ++i1) {
	    (tra_._1) .x[i__ + i1 * 6 - 7] = 0.;
	    (tra_._1) .y[i__ + i1 * 6 - 7] = 0.;
 
	}
 
    }
 

    for (i1 = 1; i1 <= 20; ++i1) {
	combin_ .icomb0[i1 - 1] = 0;
	for (i__ = 1; i__ <= 100; ++i__) {
	    combin_ .icomb[i__ + i1 * 100 - 101] = 0;
	    combin_ .ratio[i__ + i1 * 100 - 101] = 0.;
 
	}
 
    }
 

    return 0;
}  

 
 
  int corrorb_()
{
     
    static char fmt_10000[] = "(t5,\002---- ORBIT CORRECTION WITH MOST EFFCTIVE CORRECTOR \002,\002STRATEGY ----\002)";
    static char fmt_10010[] = "(t5,\002     ORBIT CORRECTION WITH \002,i4,\002 CORRECTORS UNTIL\002,/,t5,\002       HOR. RMS SMALLER THAN \002,f6.3,\002 MM\002,/,t5,\002       VER. RMS SMALLER THAN \002,f6.3,\002 MM\002)";
    static char fmt_10020[] = "(t5,\002     ORBIT CORRECTION WITH \002,i4,\002 CORRECTORS AND \002,i4,\002 ITERATIONS.\002)";
    static char fmt_10100[] = "(/,t5,\002NUMBER OF HOR. MONITORS: \002,i4,\002  NUMBER OF HOR. CORRECTORS: \002,i4,/,t5,\002NUMBER OF VER. MONITORS: \002,i4,\002  NUMBER OF VER. CORRECTORS: \002,i4)";
    static char fmt_10070[] = "(/,t5,\002ERROR: NUMBER OF MONITORS TOO BIG.\002,/\002    THERE ARE \002,i4,\002 MONITORS SET, BUT ONLY \002,i4,\002 ALLOWED.\002,/\002    NO CORRECTION DONE.\002,/)";
    static char fmt_10080[] = "(/,t5,\002ERROR: NUMBER OF CORRECTORS TOO BIG.\002,/\002    THERE ARE \002,i4,\002 MONITORS SET, BUT ONLY \002,i4,\002 ALLOWED.\002,/\002    NO CORRECTION DONE.\002,/)";
    static char fmt_10090[] = "(/,t5,\002WARNING: NUMBER OF MONITORS IS SMALLER THAN NUMBER\002,\002 OF CORRECTORS.\002,/\002    NUMERICAL PROBLEMS MIGHT BE ENCOUNTERED.\002)";
    static char fmt_10030[] = "(t5,\002---- CORRECTION ITERATION NO. \002,i4,\002 HOR.-RMS: \002,f6.3,\002 VER.-RMS: \002,f6.3)";
    static char fmt_10040[] = "(t5,\002---- CORRECTION ITERATION NO. \002,i4,\002 HOR.-PTP: \002,f6.3,\002 VER.-PTP: \002,f6.3)";
    static char fmt_10110[] = "(t10,\002HORIZONTAL RMS GOAL REACHED\002)";
    static char fmt_10120[] = "(t10,\002VERTICAL RMS GOAL REACHED\002)";
    static char fmt_10050[] = "(t5,\002     HORIZONTAL CORRECTORS USED:\002,i4,i4,i4,i4,i4,i4,i4,i4,i4,i4)";
    static char fmt_10060[] = "(t5,\002     VERTICAL   CORRECTORS USED:\002,i4,i4,i4,i4,i4,i4,i4,i4,i4,i4)";
    static char fmt_10130[] = "(t10,\002MAXIMUM NUMBER OF ITERATIONS ACHIVED: \002,i4,/,t10,\002INCREASE ITCO TO INCREASE THE NUMBER OF \002,\002CLOSED ORBIT ITERATIONS\002,/)";
    static char fmt_10140[] = "(t5,\002---- ORBIT SCALING USING ALL POSSIBLE ELEMENTS \002)";
    static char fmt_10150[] = "(t5,\002---- SCALING ITERATION NO. \002,i4,\002 HOR.-RMS: \002,f6.3,\002 VER.-RMS: \002,f6.3)";
    static char fmt_10160[] = "(t5,\002---- SCALING ITERATION NO. \002,i4,\002 HOR.-PTP: \002,f6.3,\002 VER.-PTP: \002,f6.3)";

     
    integer i__1, i__2, i__3;
    doublereal d__1, d__2;

     
    integer s_wsle(), e_wsle(), s_wsfe(), e_wsfe(), do_fio();
      int s_copy();
    double sqrt(), cos(), sin();
    integer do_lio();

     
    static doublereal b[600];
    static integer i__, j, k, l;
    static doublereal ar[360000]	 ;
    static integer ii, nx[600], ij, im;
    static doublereal clo0[2], qwc1[3];
    static integer nto;
    static doublereal orbr[600], xinc[600], rmsx, ptpx, rmsz, ptpz, clop0[2];
    extern   int htls_();
    static doublereal hfac;
    extern   int clorb_();
    static doublereal vfac;
    static integer kzz, kpz;
    static char bezlo[16*700];
    extern   int error_();
    static integer ntcoo;
    static doublereal rzero;
    static integer nlino;
    static doublereal rzero1;
    static integer icflag, ihflag;
    extern   int phasad_();
    static integer ivflag;
    extern   int calrms_(), linopt_(), putorb_(), orbinit_();
    static integer iprinto;

     
    static cilist io___201 = { 0, 6, 0, 0, 0 };
    static cilist io___202 = { 0, 6, 0, fmt_10000, 0 };
    static cilist io___203 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___204 = { 0, 6, 0, fmt_10020, 0 };
    static cilist io___205 = { 0, 6, 0, 0, 0 };
    static cilist io___213 = { 0, 6, 0, fmt_10100, 0 };
    static cilist io___214 = { 0, 6, 0, fmt_10070, 0 };
    static cilist io___215 = { 0, 6, 0, fmt_10070, 0 };
    static cilist io___216 = { 0, 6, 0, fmt_10080, 0 };
    static cilist io___217 = { 0, 6, 0, fmt_10080, 0 };
    static cilist io___218 = { 0, 6, 0, fmt_10090, 0 };
    static cilist io___219 = { 0, 6, 0, 0, 0 };
    static cilist io___229 = { 0, 6, 0, fmt_10030, 0 };
    static cilist io___230 = { 0, 6, 0, fmt_10040, 0 };
    static cilist io___231 = { 0, 6, 0, fmt_10110, 0 };
    static cilist io___232 = { 0, 6, 0, fmt_10120, 0 };
    static cilist io___233 = { 0, 6, 0, 0, 0 };
    static cilist io___235 = { 0, 6, 0, fmt_10050, 0 };
    static cilist io___237 = { 0, 6, 0, fmt_10050, 0 };
    static cilist io___238 = { 0, 6, 0, 0, 0 };
    static cilist io___239 = { 0, 6, 0, fmt_10060, 0 };
    static cilist io___240 = { 0, 6, 0, fmt_10060, 0 };
    static cilist io___241 = { 0, 6, 0, fmt_10030, 0 };
    static cilist io___242 = { 0, 6, 0, fmt_10040, 0 };
    static cilist io___243 = { 0, 6, 0, 0, 0 };
    static cilist io___244 = { 0, 6, 0, fmt_10130, 0 };
    static cilist io___245 = { 0, 6, 0, fmt_10140, 0 };
    static cilist io___251 = { 0, 6, 0, fmt_10150, 0 };
    static cilist io___252 = { 0, 6, 0, fmt_10160, 0 };
    static cilist io___253 = { 0, 6, 0, 0, 0 };
    static cilist io___254 = { 0, 6, 0, fmt_10130, 0 };
    static cilist io___255 = { 0, 28, 0, 0, 0 };
    static cilist io___256 = { 0, 29, 0, 0, 0 };


 
 
 
 

 

 

    rzero = 0.;
    rzero1 = 0.;
    for (l = 1; l <= 2; ++l) {
	clo0[l - 1] = 0.;
	clop0[l - 1] = 0.;
	beo_ .di0[l - 1] = 0.;
 
	beo_ .dip0[l - 1] = 0.;
    }
    clorb_(& clo_ .ded);
    if (erro_ .ierro > 0) {
	error_(&c__4);
    }
    for (l = 1; l <= 2; ++l) {
	clo0[l - 1] = (tra_._1) .clo[l - 1];
 
	clop0[l - 1] = (tra_._1) .clop[l - 1];
    }
    clorb_(&c_b251);
    if (erro_ .ierro > 0) {
	error_(&c__5);
    }
    for (l = 1; l <= 2; ++l) {
	beo_ .di0[l - 1] = (clo0[l - 1] - (tra_._1) .clo[l - 1]) / clo_ .ded;
 
	beo_ .dip0[l - 1] = (clop0[l - 1] - (tra_._1) .clop[l - 1]) / clo_ .ded;
    }
    for (l = 1; l <= 600; ++l) {
	xinc[l - 1] = (float)0.;
 
	nx[l - 1] = 0;
    }
    if (clos_ .iclo == 0) {
	return 0;
    }
 
    ihflag = 0;
    ivflag = 0;
    icflag = 0;
    s_wsle(&io___201);
    e_wsle();
    s_wsfe(&io___202);
    e_wsfe();
    if (clos_ .ncorru == 0) {
	error_(&c__84);
    } else {
	if (clos_ .ncorrep <= 0) {
	    s_wsfe(&io___203);
	    do_fio(&c__1, (char *)& clos_ .ncorru, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)& clos_ .sigma0[0], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& clos_ .sigma0[1], (ftnlen)sizeof(
		    doublereal));
	    e_wsfe();
	} else {
	    s_wsfe(&io___204);
	    do_fio(&c__1, (char *)& clos_ .ncorru, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)& clos_ .ncorrep, (ftnlen)sizeof(integer));
	    e_wsfe();
	}
    }
    s_wsle(&io___205);
    e_wsle();
 
    iprinto = linop_ .iprint;
    nto = linop_ .nt;
    ntcoo = linop_ .ntco;
    i__1 = linop_ .nlin;
    for (i__ = 1; i__ <= i__1; ++i__) {
	s_copy(bezlo + (i__ - 1 << 4), linopc_ .bezl + (i__ - 1 << 4), 16L, 
		16L);
 
    }
    nlino = linop_ .nlin;
 
 
    linop_ .iprint = 0;
    linop_ .ntco = 0;
    linop_ .nlin = 0;
    i__1 = str_ .il;
    for (i__ = 1; i__ <= i__1; ++i__) {
	if (ell_ .kp[i__ - 1] == 3 || ell_ .kp[i__ - 1] == 4 || ell_ .kp[i__ 
		- 1] == -3 || ell_ .kp[i__ - 1] == -4) {
	    s_copy(linopc_ .bezl + (i__ - 1 << 4), linopc_ .bez + (i__ - 1 << 
		    4), 16L, 16L);
	}
	++ linop_ .nlin;
 
    }
    linopt_(&c_b251);
    phasad_(&c_b251, qwc1);
 
    s_wsfe(&io___213);
    do_fio(&c__1, (char *)& cororb_ .nhmoni, (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)& cororb_ .nhcorr, (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)& cororb_ .nvmoni, (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)& cororb_ .nvcorr, (ftnlen)sizeof(integer));
    e_wsfe();
    if (cororb_ .nhmoni > 600) {
	s_wsfe(&io___214);
	do_fio(&c__1, (char *)& cororb_ .nhmoni, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)&c__600, (ftnlen)sizeof(integer));
	e_wsfe();
	return 0;
    }
    if (cororb_ .nvmoni > 600) {
	s_wsfe(&io___215);
	do_fio(&c__1, (char *)& cororb_ .nvmoni, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)&c__600, (ftnlen)sizeof(integer));
	e_wsfe();
	return 0;
    }
    if (cororb_ .nhcorr > 600) {
	s_wsfe(&io___216);
	do_fio(&c__1, (char *)& cororb_ .nhcorr, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)&c__600, (ftnlen)sizeof(integer));
	e_wsfe();
	return 0;
    }
    if (cororb_ .nvcorr > 600) {
	s_wsfe(&io___217);
	do_fio(&c__1, (char *)& cororb_ .nvcorr, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)&c__600, (ftnlen)sizeof(integer));
	e_wsfe();
	return 0;
    }
    if (cororb_ .nhmoni < cororb_ .nhcorr || cororb_ .nvmoni < 
	    cororb_ .nvcorr) {
	s_wsfe(&io___218);
	e_wsfe();
    }
    s_wsle(&io___219);
    e_wsle();
    orbinit_();
 
    if (clos_ .ncorrep == 0) {
	icflag = 1;
	clos_ .ncorrep = clo_ .itco;
    }
    i__1 = clos_ .ncorrep;
    for (ii = 1; ii <= i__1; ++ii) {
 
	i__2 = cororb_ .nhmoni;
	for (i__ = 1; i__ <= i__2; ++i__) {
	    b[i__ - 1] = cororb_ .bclorb[i__ - 1];
	    i__3 = cororb_ .nhcorr;
	    for (j = 1; j <= i__3; ++j) {
		ar[i__ + j * 600 - 601] = sqrt(cororb_ .betam[i__ - 1] * 
			cororb_ .betac[j - 1]) * cos((d__1 = cororb_ .pam[i__ 
			- 1] - cororb_ .pac[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) - qwc1[0] * 
			kons_ .pi) * 1e3 / (sin(qwc1[0] * kons_ .pi) * 2);
 
	    }
	}
	calrms_(b, & cororb_ .nhmoni, &rmsx, &ptpx);
 
	htls_(ar, b, & cororb_ .nhmoni, & cororb_ .nhcorr, xinc, nx, orbr, &
		clos_ .ncorru, &rzero, &rzero1);
 
	i__3 = cororb_ .nvmoni;
	for (i__ = 1; i__ <= i__3; ++i__) {
	    b[i__ - 1] = cororb_ .bclorb[i__ + 599];
	    i__2 = cororb_ .nvcorr;
	    for (j = 1; j <= i__2; ++j) {
		ar[i__ + j * 600 - 601] = sqrt(cororb_ .betam[i__ + 599] * 
			cororb_ .betac[j + 599]) * cos((d__1 = cororb_ .pam[
			i__ + 599] - cororb_ .pac[j + 599], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) - qwc1[
			1] * kons_ .pi) * 1e3 / (sin(qwc1[1] * kons_ .pi) * 2)
			;
 
	    }
	}
	calrms_(b, & cororb_ .nvmoni, &rmsz, &ptpz);
	s_wsfe(&io___229);
	i__2 = ii - 1;
	do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)&rmsx, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&rmsz, (ftnlen)sizeof(doublereal));
	e_wsfe();
	s_wsfe(&io___230);
	i__2 = ii - 1;
	do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)&ptpx, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&ptpz, (ftnlen)sizeof(doublereal));
	e_wsfe();
	if (icflag == 1 && clos_ .sigma0[0] > rmsx && ihflag == 0) {
	    s_wsfe(&io___231);
	    e_wsfe();
	    ihflag = 1;
	}
	if (icflag == 1 && clos_ .sigma0[1] > rmsz && ivflag == 0) {
	    s_wsfe(&io___232);
	    e_wsfe();
	    ivflag = 1;
	}
	if (ihflag == 0) {
	    s_wsle(&io___233);
	    e_wsle();
	    i__2 = clos_ .ncorru / 10;
	    for (ij = 1; ij <= i__2; ++ij) {
		s_wsfe(&io___235);
		for (k = 1; k <= 10; ++k) {
		    do_fio(&c__1, (char *)&nx[(ij - 1) * 10 + k - 1], (ftnlen)
			    sizeof(integer));
		}
		e_wsfe();
 
	    }
	    if (clos_ .ncorru % 10 > 0) {
		s_wsfe(&io___237);
		i__2 = clos_ .ncorru % 10;
		for (k = 1; k <= i__2; ++k) {
		    do_fio(&c__1, (char *)&nx[(ij - 1) * 10 + k - 1], (ftnlen)
			    sizeof(integer));
		}
		e_wsfe();
	    }
	    putorb_(xinc, nx, &c__1);
	}
 
	htls_(ar, b, & cororb_ .nvmoni, & cororb_ .nvcorr, xinc, nx, orbr, &
		clos_ .ncorru, &rzero, &rzero1);
	if (ivflag == 0) {
	    s_wsle(&io___238);
	    e_wsle();
	    i__2 = clos_ .ncorru / 10;
	    for (ij = 1; ij <= i__2; ++ij) {
		s_wsfe(&io___239);
		for (k = 1; k <= 10; ++k) {
		    do_fio(&c__1, (char *)&nx[(ij - 1) * 10 + k - 1], (ftnlen)
			    sizeof(integer));
		}
		e_wsfe();
 
	    }
	    if (clos_ .ncorru % 10 > 0) {
		s_wsfe(&io___240);
		i__2 = clos_ .ncorru % 10;
		for (k = 1; k <= i__2; ++k) {
		    do_fio(&c__1, (char *)&nx[(ij - 1) * 10 + k - 1], (ftnlen)
			    sizeof(integer));
		}
		e_wsfe();
	    }
	    putorb_(xinc, nx, &c__2);
	}
	if (ihflag == 1 && ivflag == 1) {
	    goto L140;
	}
	linopt_(&c_b251);
	phasad_(&c_b251, qwc1);
 
    }
 
    i__1 = cororb_ .nhmoni;
    for (i__ = 1; i__ <= i__1; ++i__) {
	b[i__ - 1] = cororb_ .bclorb[i__ - 1];
 
    }
    calrms_(b, & cororb_ .nhmoni, &rmsx, &ptpx);
    i__1 = cororb_ .nvmoni;
    for (i__ = 1; i__ <= i__1; ++i__) {
	b[i__ - 1] = cororb_ .bclorb[i__ + 599];
 
    }
    calrms_(b, & cororb_ .nvmoni, &rmsz, &ptpz);
    s_wsfe(&io___241);
    do_fio(&c__1, (char *)& clos_ .ncorrep, (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)&rmsx, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)&rmsz, (ftnlen)sizeof(doublereal));
    e_wsfe();
    s_wsfe(&io___242);
    do_fio(&c__1, (char *)& clos_ .ncorrep, (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)&ptpx, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)&ptpz, (ftnlen)sizeof(doublereal));
    e_wsfe();
    s_wsle(&io___243);
    e_wsle();
L140:
    if (ii - 1 == clo_ .itco) {
	s_wsfe(&io___244);
	do_fio(&c__1, (char *)& clo_ .itco, (ftnlen)sizeof(integer));
	e_wsfe();
    }
 
    if (clos_ .sigma0[0] > 1e-17 || clos_ .sigma0[1] > 1e-17) {
	i__1 = clo_ .itco;
	for (ii = 1; ii <= i__1; ++ii) {
	    s_wsfe(&io___245);
	    e_wsfe();
	    hfac = clos_ .sigma0[0] / rmsx;
	    vfac = clos_ .sigma0[1] / rmsz;
	    i__2 = str_ .il;
	    for (i__ = 1; i__ <= i__2; ++i__) {
		kzz = ell_ .kz[i__ - 1];
		kpz = ell_ .kp[i__ - 1];
		if (kzz == 1 && ell_ .el[i__ - 1] < 1e-17) {
		    ell_ .ed[i__ - 1] *= hfac;
		    ell_ .ek[i__ - 1] *= hfac;
		}
		if (kzz == -1 && ell_ .el[i__ - 1] < 1e-17) {
		    ell_ .ed[i__ - 1] *= vfac;
		    ell_ .ek[i__ - 1] *= vfac;
		}
		if (kzz == 11) {
		    im = mult1_ .irm[i__ - 1];
		    multi_ .ak0[im - 1] *= vfac;
		    multi_ .aka[im - 1] *= vfac;
		    multi_ .bk0[im - 1] *= hfac;
		    multi_ .bka[im - 1] *= hfac;
		}
 
	    }
	    linopt_(&c_b251);
	    i__2 = cororb_ .nhmoni;
	    for (i__ = 1; i__ <= i__2; ++i__) {
		b[i__ - 1] = cororb_ .bclorb[i__ - 1];
 
	    }
	    calrms_(b, & cororb_ .nhmoni, &rmsx, &ptpx);
	    i__2 = cororb_ .nvmoni;
	    for (i__ = 1; i__ <= i__2; ++i__) {
		b[i__ - 1] = cororb_ .bclorb[i__ + 599];
 
	    }
	    calrms_(b, & cororb_ .nvmoni, &rmsz, &ptpz);
	    s_wsfe(&io___251);
	    do_fio(&c__1, (char *)&ii, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&rmsx, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&rmsz, (ftnlen)sizeof(doublereal));
	    e_wsfe();
	    s_wsfe(&io___252);
	    do_fio(&c__1, (char *)&ii, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&ptpx, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&ptpz, (ftnlen)sizeof(doublereal));
	    e_wsfe();
	    s_wsle(&io___253);
	    e_wsle();
	    if ((d__1 = rmsx - clos_ .sigma0[0], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) < clo_ .dsi && (
		    d__2 = rmsz - clos_ .sigma0[1], (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) ) < clo_ .dsi) {
		goto L190;
	    }
 
	}
    }
    if (ii - 1 == clo_ .itco) {
	s_wsfe(&io___254);
	do_fio(&c__1, (char *)& clo_ .itco, (ftnlen)sizeof(integer));
	e_wsfe();
    }
L190:
 
    i__1 = cororb_ .nhmoni;
    for (i__ = 1; i__ <= i__1; ++i__) {
	s_wsle(&io___255);
	do_lio(&c__3, &c__1, (char *)&i__, (ftnlen)sizeof(integer));
	do_lio(&c__5, &c__1, (char *)& cororb_ .bclorb[i__ - 1], (ftnlen)
		sizeof(doublereal));
	e_wsle();
 
    }
    i__1 = cororb_ .nhmoni;
    for (i__ = 1; i__ <= i__1; ++i__) {
	s_wsle(&io___256);
	do_lio(&c__3, &c__1, (char *)&i__, (ftnlen)sizeof(integer));
	do_lio(&c__5, &c__1, (char *)& cororb_ .bclorb[i__ + 599], (ftnlen)
		sizeof(doublereal));
	e_wsle();
 
    }
 
    linop_ .iprint = iprinto;
    linop_ .nt = nto;
    linop_ .ntco = ntcoo;
    linop_ .nlin = nlino;
    i__1 = linop_ .nlin;
    for (i__ = 1; i__ <= i__1; ++i__) {
	s_copy(linopc_ .bezl + (i__ - 1 << 4), bezlo + (i__ - 1 << 4), 16L, 
		16L);
 
    }
    clos_ .ncorru = 0;
 

    return 0;
}  

 
  int cpart6_(h__, ch)
integer *h__, *ch;
{
    extern   doublereal rext6_();
    extern   int daall_(), dacfu_();

 



    daall_(h__, &c__1, "H         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(ch, &c__1, "CH        ", & ii_ .no, & ii_ .nv, 10L);
 
    dacfu_(h__, rext6_, ch);
    return 0;
}  

 
 
  int cphase_(k, a, b, c__, d__, i__, j, ie)
integer *k;
doublereal *a, *b, *c__, *d__;
integer *i__, *j, *ie;
{
     
    double atan(), atan2();

     
    static doublereal f, tpi;

 

 

    tpi = atan(1.) * 8;
    if ((( *b ) >= 0 ? ( *b ) : -( *b ))  > 1e-17 || (( *c__ ) >= 0 ? ( *c__ ) : -( *c__ ))  > 1e-17) {
	f = atan2(*b, *c__);
	++(*ie);
	(phase_._1) .p[*k + *ie * 3 - 4] = f / tpi + *d__;
	if (*i__ != 1 && -f > 1e-17) {
	    (phase_._1) .p[*k + *ie * 3 - 4] += 1.;
	}
	*a += (phase_._1) .p[*k + *ie * 3 - 4];
    } else {
	*j = 1;
    }
    return 0;
}  

 
 
  int cpltwis_(typ, t, etl, phi, typ_len)
char *typ;
doublereal *t, *etl, *phi;
ftnlen typ_len;
{
     
    integer i__1;
    doublereal d__1;

     
    integer s_cmp();
    double atan2(), sqrt(), cos(), atan();
    integer s_wsue(), do_uio(), e_wsue();

     
    static integer i__;
    static doublereal bexi, bezi, alxi, alzi, gaxi, gazi, phxi, phzi, bexii, 
	    gaxii, bezii, gazii, alxii, alzii, phxii, phzii, phxpi, phzpi, 
	    phxpii;
    static integer iwrite;
    static doublereal phzpii, couuang;

     
    static cilist io___282 = { 0, 11, 0, 0, 0 };


 

 
 
 
 
 
 
 
 
 
 

 

     
    --phi;
    t -= 7;

     
    iwrite = 0;
    if (linop_ .nlin == 0) {
	iwrite = 1;
    } else {
	i__1 = linop_ .nlin;
	for (i__ = 1; i__ <= i__1; ++i__) {
	    if (s_cmp(typ, linopc_ .bezl + (i__ - 1 << 4), 16L, 16L) == 0) {
		iwrite = 1;
	    }
 
	}
    }
    if (iwrite == 1) {
	bexi = t[8] * t[8] + t[9] * t[9];
	bexii = t[10] * t[10] + t[11] * t[11];
	bezi = t[20] * t[20] + t[21] * t[21];
	bezii = t[22] * t[22] + t[23] * t[23];
	alxi = -(t[8] * t[14] + t[9] * t[15]);
	alxii = -(t[10] * t[16] + t[11] * t[17]);
	alzi = -(t[20] * t[26] + t[21] * t[27]);
	alzii = -(t[22] * t[28] + t[23] * t[29]);
	gaxi = t[14] * t[14] + t[15] * t[15];
	gaxii = t[16] * t[16] + t[17] * t[17];
	gazi = t[26] * t[26] + t[27] * t[27];
	gazii = t[28] * t[28] + t[29] * t[29];
	if ((( t[8] ) >= 0 ? ( t[8] ) : -( t[8] ))  > 1e-17) {
	    phxi = atan2(t[9], t[8]);
	}
	if ((( t[10] ) >= 0 ? ( t[10] ) : -( t[10] ))  > 1e-17) {
	    phxii = atan2(t[11], t[10]);
	}
	if ((( t[20] ) >= 0 ? ( t[20] ) : -( t[20] ))  > 1e-17) {
	    phzi = atan2(t[21], t[20]);
	}
	if ((( t[22] ) >= 0 ? ( t[22] ) : -( t[22] ))  > 1e-17) {
	    phzii = atan2(t[23], t[22]);
	}
	if ((( t[14] ) >= 0 ? ( t[14] ) : -( t[14] ))  > 1e-17) {
	    phxpi = atan2(t[15], t[14]);
	}
	if ((( t[16] ) >= 0 ? ( t[16] ) : -( t[16] ))  > 1e-17) {
	    phxpii = atan2(t[17], t[16]);
	}
	if ((( t[26] ) >= 0 ? ( t[26] ) : -( t[26] ))  > 1e-17) {
	    phzpi = atan2(t[27], t[26]);
	}
	if ((( t[28] ) >= 0 ? ( t[28] ) : -( t[28] ))  > 1e-17) {
	    phzpii = atan2(t[29], t[28]);
	}
	if ((( t[8] ) >= 0 ? ( t[8] ) : -( t[8] ))  <= 1e-17) {
	    phxi = kons_ .pi / 2.;
	}
	if ((( t[10] ) >= 0 ? ( t[10] ) : -( t[10] ))  <= 1e-17) {
	    if (bexii > 1e-17) {
		phxii = kons_ .pi / 2.;
	    }
	    if (bexii <= 1e-17) {
		phxii = 0.;
	    }
	}
	if ((( t[20] ) >= 0 ? ( t[20] ) : -( t[20] ))  <= 1e-17) {
	    if (bezi > 1e-17) {
		phzi = kons_ .pi / 2.;
	    }
	    if (bezi <= 1e-17) {
		phzi = 0.;
	    }
	}
	if ((( t[22] ) >= 0 ? ( t[22] ) : -( t[22] ))  <= 1e-17) {
	    phzii = kons_ .pi / 2.;
	}
	if ((( t[14] ) >= 0 ? ( t[14] ) : -( t[14] ))  <= 1e-17) {
	    phxpi = kons_ .pi / 2.;
	}
	if ((( t[16] ) >= 0 ? ( t[16] ) : -( t[16] ))  <= 1e-17) {
	    if (gaxii > 1e-17) {
		phxpii = kons_ .pi / 2.;
	    }
	    if (gaxii <= 1e-17) {
		phxpii = 0.;
	    }
	}
	if ((( t[26] ) >= 0 ? ( t[26] ) : -( t[26] ))  <= 1e-17) {
	    if (gazi > 1e-17) {
		phzpi = kons_ .pi / 2.;
	    }
	    if (gazi <= 1e-17) {
		phzpi = 0.;
	    }
	}
	if ((( t[28] ) >= 0 ? ( t[28] ) : -( t[28] ))  <= 1e-17) {
	    phzpii = kons_ .pi / 2.;
	}
	if ((d__1 = linop_ .eui * (bexi - bezi) + linop_ .euii * (bexii - 
		bezii), (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
	    couuang = atan((linop_ .eui * sqrt(bexi * bezi) * cos(phxi - phzi)
		     + linop_ .euii * sqrt(bexii * bezii) * cos(phxii - phzii)
		    ) * 2. / (linop_ .eui * (bexi - bezi) + linop_ .euii * (
		    bexii - bezii))) * .5;
	} else {
	    couuang = 0.;
	}
	s_wsue(&io___282);
	do_uio(&c__1, typ, 16L);
	do_uio(&c__1, (char *)&(*etl), (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)&phi[1], (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)&bexi, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)&bexii, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)&bezi, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)&bezii, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)&alxi, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)&alxii, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)&alzi, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)&alzii, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)&gaxi, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)&gaxii, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)&gazi, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)&gazii, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)&phxi, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)&phxii, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)&phzi, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)&phzii, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)&phxpi, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)&phxpii, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)&phzpi, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)&phzpii, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)&couuang, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)&t[12], (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)&t[18], (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)&t[24], (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)&t[30], (ftnlen)sizeof(doublereal));
	e_wsue();
    }
    return 0;
}  

 
  int creat6_()
{
     
    integer i__1;

     
    static integer i__, j[20];
    extern   int daadd_(), daall_(), dacop_(), dalin_(), 
	    davar_(), dasub_();

 
 
 




    daall_(& nom_ .bb1, &c__1, "BB1       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(& nom_ .bb2, &c__1, "BB2       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(nom_ .rot, &c__12, "ROT       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(nom_ .roti, &c__12, "ROTI      ", & ii_ .no, & ii_ .nv, 10L);
    daall_(nom_ .rel, &c__12, "REL       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(& super_ .fs, &c__1, "FS        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(nom_ .ctr, &c__12, "CTR       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(nom_ .cjg, &c__12, "CJG       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(nom_ .rtc, &c__12, "RTC       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(vecteur_ .a2, &c__12, "A2        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(vecteur_ .a2i, &c__12, "A2I       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(vecteur_ .cm, &c__12, "CM        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(vecteur_ .a1, &c__12, "A1        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(vecteur_ .v, &c__12, "V         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(vecteur_ .w, &c__12, "W         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(vecteur_ .x, &c__12, "X         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(vecteur_ .xy, &c__12, "XY        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(& vecteur_ .h__, &c__1, "H         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(& vecteur_ .ft, &c__1, "FT        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(vecteur_ .a1i, &c__12, "A1I       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(& super_ .hs, &c__1, "HS        ", & ii_ .no, & ii_ .nv, 10L);
 
    i__1 = ii_ .nv;
    for (i__ = 1; i__ <= i__1; ++i__) {
	j[i__ - 1] = 0;
	davar_(& nom_ .rel[i__ - 1], &c_b251, &i__);
	dacop_(& nom_ .rel[i__ - 1], & nom_ .cjg[i__ - 1]);
 
    }
    for (i__ = 1; i__ <= 6; ++i__) {
	davar_(& vecteur_ .xy[i__ - 1], &c_b251, &i__);
	davar_(& vecteur_ .a1[i__ - 1], &c_b251, &i__);
	davar_(& vecteur_ .a1i[i__ - 1], &c_b251, &i__);
	davar_(& vecteur_ .x[i__ - 1], &c_b251, &i__);
	davar_(& vecteur_ .v[i__ - 1], &c_b251, &i__);
 
	davar_(& vecteur_ .w[i__ - 1], &c_b251, &i__);
    }
    for (i__ = 1; i__ <= 3; ++i__) {
	daadd_(& nom_ .rel[(i__ << 1) - 2], & nom_ .rel[(i__ << 1) - 1], &
		nom_ .rtc[(i__ << 1) - 2]);
	dasub_(& nom_ .rel[(i__ << 1) - 2], & nom_ .rel[(i__ << 1) - 1], &
		nom_ .rtc[(i__ << 1) - 1]);
	dalin_(& nom_ .rel[(i__ << 1) - 2], &c_b461, & nom_ .rel[(i__ << 1) - 1]
		, &c_b461, & nom_ .ctr[(i__ << 1) - 2]);
 
	dalin_(& nom_ .rel[(i__ << 1) - 2], &c_b461, & nom_ .rel[(i__ << 1) - 1]
		, &c_b464, & nom_ .ctr[(i__ << 1) - 1]);
    }
    i__1 = ii_ .nv;
    for (i__ = 7; i__ <= i__1; ++i__) {
	davar_(& nom_ .rot[i__ - 1], &c_b251, &i__);
	davar_(& nom_ .roti[i__ - 1], &c_b251, &i__);
	davar_(& vecteur_ .a2[i__ - 1], &c_b251, &i__);
	davar_(& vecteur_ .a2i[i__ - 1], &c_b251, &i__);
	davar_(& vecteur_ .cm[i__ - 1], &c_b251, &i__);
	davar_(& vecteur_ .xy[i__ - 1], &c_b251, &i__);
	davar_(& vecteur_ .a1[i__ - 1], &c_b251, &i__);
	davar_(& vecteur_ .a1i[i__ - 1], &c_b251, &i__);
	davar_(& vecteur_ .x[i__ - 1], &c_b251, &i__);
	davar_(& vecteur_ .v[i__ - 1], &c_b251, &i__);
	davar_(& vecteur_ .w[i__ - 1], &c_b251, &i__);
	davar_(& nom_ .rtc[i__ - 1], &c_b251, &i__);
 
	davar_(& nom_ .ctr[i__ - 1], &c_b251, &i__);
    }
    return 0;
}  

 
  int ctrbasi6_(hc, hr, ctr, cjg)
integer *hc, *hr, *ctr, *cjg;
{
     

    static integer b1 = 0;
    static integer b2 = 0;

    extern   int trx6_(), dadal_(), daall_(), dacop_(), dalin_(
	    ), cpart6_();

 
 
 
 
 
 


     
    --cjg;
    --ctr;

     

    daall_(hr, &c__1, "hr        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(hc, &c__1, "hc        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&ctr[1], &c__12, "ctr       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&cjg[1], &c__12, "cjg       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&b1, &c__1, "b1        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&b2, &c__1, "b2        ", & ii_ .no, & ii_ .nv, 10L);
 
 
    cpart6_(hc, &b1);
 
    trx6_(&b1, hr, &ctr[1]);
    trx6_(hr, hc, &cjg[1]);
    dalin_(hr, &c_b461, hc, &c_b461, &b1);
    dalin_(hr, &c_b461, hc, &c_b464, &b2);
    dacop_(&b1, hc);
    dacop_(&b2, hr);
    dadal_(&b2, &c__1);
    dadal_(&b1, &c__1);
    return 0;
}  

 
  int dacond6_(h__, r__)
integer *h__;
doublereal *r__;
{
    static integer i__;
    extern   int daall_(), dacon_();

 



     
    --h__;

     
    daall_(&h__[1], &c__12, "H         ", & ii_ .no, & ii_ .nv, 10L);
 
    for (i__ = 1; i__ <= 6; ++i__) {
 
	dacon_(&h__[i__], r__);
    }
    return 0;
}  

 
  int dacopd6_(h__, ht)
integer *h__, *ht;
{
    static integer i__;
    extern   int daall_(), dacop_();

 



     
    --ht;
    --h__;

     
    daall_(&h__[1], &c__12, "H         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&ht[1], &c__12, "HT        ", & ii_ .no, & ii_ .nv, 10L);
 
    for (i__ = 1; i__ <= 6; ++i__) {
 
	dacop_(&h__[i__], &ht[i__]);
    }
    return 0;
}  

 
  int dalie6s_(iqmod6, nz, wx, cor6d)
integer *iqmod6, *nz;
doublereal *wx, *cor6d;
{
     
    doublereal d__1;

     
    double atan();
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer i__;
    static doublereal eps;
    static integer noo, nvo;
    static doublereal x2pi;
    extern   int daall_(), daini_(), daeps_(), mainia6_();

     
    static cilist io___292 = { 0, 6, 0, 0, 0 };
    static cilist io___293 = { 0, 6, 0, 0, 0 };
    static cilist io___294 = { 0, 6, 0, 0, 0 };
    static cilist io___296 = { 0, 6, 0, 0, 0 };
    static cilist io___297 = { 0, 6, 0, 0, 0 };


     
    cor6d -= 3;
    --wx;

     
    x2pi = atan(1.) * 8.;
    noo = ii_ .no;
    nvo = ii_ .nv;
    ii_ .no = *nz;
    if (*iqmod6 != 1) {
	ii_ .nv = 6;
    } else {
	ii_ .nv = 8;
    }
    s_wsle(&io___292);
    do_lio(&c__9, &c__1, "   ---- ENTRY DALIE ----", 24L);
    e_wsle();
    s_wsle(&io___293);
    do_lio(&c__9, &c__1, "TUNES : WX,WY,WT", 16L);
    e_wsle();
    s_wsle(&io___294);
    for (i__ = 1; i__ <= 3; ++i__) {
	do_lio(&c__5, &c__1, (char *)&wx[i__], (ftnlen)sizeof(doublereal));
    }
    e_wsle();
    s_wsle(&io___296);
    do_lio(&c__9, &c__1, "ORDER, # VARIABLES", 18L);
    e_wsle();
    s_wsle(&io___297);
    do_lio(&c__3, &c__1, (char *)& ii_ .no, (ftnlen)sizeof(integer));
    do_lio(&c__3, &c__1, (char *)& ii_ .nv, (ftnlen)sizeof(integer));
    e_wsle();
    for (i__ = 1; i__ <= 3; ++i__) {
	tune_ .angle[i__ - 1] = wx[i__] * x2pi;
 
    }
    daini_(& ii_ .no, & ii_ .nv, &c__0);
    daall_(dascr_ .iscrda, &c__100, "$$IS      ", & ii_ .no, & ii_ .nv, 10L);
    eps = 1e-38;
    daeps_(&eps);
    mainia6_(iqmod6, &eps, &cor6d[3]);
    for (i__ = 1; i__ <= 3; ++i__) {
	wx[i__] = tune_ .angle[i__ - 1] / x2pi;
 
    }
    if ((( wx[3] ) >= 0 ? ( wx[3] ) : -( wx[3] ))  > .5) {
	wx[3] = (d__1 = (( wx[3] ) >= 0 ? ( wx[3] ) : -( wx[3] ))  - 1., (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
    }
    ii_ .no = noo;
    ii_ .nv = nvo;
    return 0;
}  

 
  int dalind6_(h__, rh, ht, rt, hr)
integer *h__;
doublereal *rh;
integer *ht;
doublereal *rt;
integer *hr;
{
    static integer i__;
    extern   int daall_(), dalin_();

 



     
    --hr;
    --ht;
    --h__;

     
    daall_(&h__[1], &c__12, "H         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&ht[1], &c__12, "HT        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&hr[1], &c__12, "HR        ", & ii_ .no, & ii_ .nv, 10L);
 
    for (i__ = 1; i__ <= 6; ++i__) {
 
	dalin_(&h__[i__], rh, &ht[i__], rt, &hr[i__]);
    }
    return 0;
}  

 
  int daprid6_(h__, k)
integer *h__, *k;
{
    static integer i__;
    extern   int daall_(), dapri_();

 



     
    --h__;

     
    daall_(&h__[1], &c__12, "H         ", & ii_ .no, & ii_ .nv, 10L);
 
    for (i__ = 1; i__ <= 6; ++i__) {
 
	dapri_(&h__[i__], k);
    }
    return 0;
}  

 
 
  int daten_()
{
     

    static char sing[16+1] = "SING            ";
    static char stru[16+1] = "STRU            ";
    static char prin[16+1] = "PRIN            ";
    static char sync[16+1] = "SYNC            ";
    static char ende[16+1] = "ENDE            ";
    static char next[16+1] = "NEXT            ";
    static char comm[16+1] = "COMM            ";
    static char fluc[16+1] = "FLUC            ";
    static char mult[16+1] = "MULT            ";
    static char chro[16+1] = "CHRO            ";
    static char iter[16+1] = "ITER            ";
    static char tune[16+1] = "TUNE            ";
    static char line[16+1] = "LINE            ";
    static char trac[16+1] = "TRAC            ";
    static char diff[16+1] = "DIFF            ";
    static char limi[16+1] = "LIMI            ";
    static char orbi[16+1] = "ORBI            ";
    static char bloc[16+1] = "BLOC            ";
    static char init[16+1] = "INIT            ";
    static char go[16+1] = "GO              ";
    static char sear[16+1] = "SEAR            ";
    static char subr[16+1] = "SUBR            ";
    static char reso[16+1] = "RESO            ";
    static char disp[16+1] = "DISP            ";
    static char post[16+1] = "POST            ";
    static char ripp[16+1] = "RIPP            ";
    static char deco[16+1] = "DECO            ";
    static char rect[16+1] = "RE              ";
    static char comb[16+1] = "COMB            ";
    static char free[16+1] = "FREE            ";
    static char geom[16+1] = "GEOM            ";
    static char cavi[16+1] = "CAV             ";
    static char beam[16+1] = "BEAM            ";
    static char idum[16+1] = "                ";
    static char kl[16+1] = "(               ";
    static char kr[16+1] = ")               ";
    static char orga[16+1] = "ORGA            ";
    static char norm[16+1] = "NORM            ";
    static char corr[16+1] = "CORR            ";

     
    static char fmt_10010[] = "(a4,8x,a60)";
    static char fmt_10130[] = "(\002 \002/131(\002-\002)/)";
    static char fmt_10030[] = "(t10,22(\002o\002)/t10,2(\002o\002),18x,2(\002o\002)/t10,\002OO  SIXTRACK-INPUT  OO\002,/t10,2(\002o\002),18x,2(\002o\002)/t10,22(\002o\002))";
    static char fmt_10180[] = "(t5/t10,a60)";
    static char fmt_10190[] = "(t10,\002PROGRAM MODE : FREE FORMAT INPUT\002)"
	    ;
    static char fmt_10200[] = "(t10,\002PROGRAM MODE : FREE FORMAT INPUT --READ FROM \002,\002EXTRA GEOMETRY STRENGTH FILE--\002)";
    static char fmt_10000[] = "(11(a4,1x))";
    static char fmt_10020[] = "(a80)";
    static char fmt_10370[] = "(t10,\002DESIRED TUNE TO ADJUST IS ZERO\002/t10,\002DATA BLOCK TUNE ADJUSTMENT  IGNORED\002)";
    static char fmt_10340[] = "(t10,\002NO CAVITIES SPECIFIED\002/)";
    static char fmt_10210[] = "(t10,\002DATA BLOCK MULTIPOLE COEFFICIENTS\002/t10,\002MULTIPOLE                    \002,a16/t10,\002RADIUS IN MM            \002,f15.7/t10,\002BENDING STRENGTH IN MRAD\002,f15.7//t10,19x,\002NORMAL\002,25x,\002      SKEW \002//t10,\002      MEAN            RMS-VALUE     \002,\002       MEAN            RMS-VALUE\002/)";
    static char fmt_10220[] = "(t10,i4,2(\002 \002,d15.8),5x,2(\002 \002,d15.8))";
    static char fmt_10380[] = "(t10,\002HIGHER MULTIPOLES THAN 20-POLES ARE NOT ALLOWED\002,\002 AND THEREFORE IGNORED\002)";
    static char fmt_10410[] = "(//131(\002-\002)//t10,\002DATA BLOCK FLUCTUATIONS OF MULTIPOLES\002//t10,\002RANDOM STARTING NUMBER=  \002,i20/t10,\002RANDOM NUMBERS GENERATED:\002,i20/t10,\002MEAN VALUE=\002,f15.7,\002  -   DEVIATION=\002,f15.7)";
    static char fmt_10430[] = "(/5x,\002No cut on random distribution\002//)";
    static char fmt_10440[] = "(/5x,\002Random distribution has been cut to: \002,i4,\002 sigma.\002//)";
    static char fmt_10350[] = "(//131(\002-\002)//t10,\002DATA BLOCK ORGANISATION OF RANDOM NUMBERS\002/5x,\002|          |      OWN RANDOM NUMBERS      |      SAME RAN\002,\002DOM NUMBERS      |   SAME MULTIPOLECOEFFICIENTS  |\002/131(\002-\002))";
    static char fmt_10360[] = "(5x,\002| ELEMENT  |           \002,a16,\002           |           \002,\002    |               |               |               |\002)";
    static char fmt_10390[] = "(5x,\002| ELEMENTS |                              |    \002,a16,\002   |    \002,a16,\002   |               |               |\002)";
    static char fmt_10400[] = "(5x,\002| ELEMENTS |                              |          \002,\002     |               |    \002,a16,\002   |    \002,a16,\002   |\002)";
    static char fmt_10320[] = "(//131(\002-\002)//t10,\002DATA BLOCK APERTURE LIMITATIONS\002//t10,\002TYP\002,t20,\002FORM\002,t30,\002APERT-H\002,t40,\002APERT-V\002)";
    static char fmt_10330[] = "(t8,a16,t18,a2,t30,f8.2,t40,f8.2)";
    static char fmt_10300[] = "(//131(\002-\002)//t10,\002DATA BLOCK COMBINATION OF ELEMENTS\002,\002  THE FOLLOWING ELEMENTS ARE RELATED IN STRENGTHS--->\002/t10,\002ELEMENT RELATED TO ELEMENT BY THE RATIO\002/)";
    static char fmt_10310[] = "(t10,a16,10x,a16,6x,f20.15)";
    static char fmt_10290[] = "(t10,\002MORE THAN \002,i5,\002 COMBINATIONS SPECIFIED\002/)";
    static char fmt_10050[] = "(//131(\002-\002)//t43,\002*** RING PARAMETERS ***\002/)";
    static char fmt_10060[] = "(t30,\002SINGLE ELEMENTS:\002/\002  NO   NAME  TYP      \002,\002 1/RHO          STRENGTH          LENGTH           X-POS     \002,\002     X-RMS            Z-PO          Z-RMS     \002/131(\002-\002))";
    static char fmt_10070[] = "(1x,i3,1x,a16,1x,i3,1x,d16.10,1x,d16.10,1x,d16.10,1x,d13.7,1x,d12.6,1x,d13.7,1x,d12.6)";
    static char fmt_10080[] = "(\002 \002/t30,\002RINGSTRUCTURE:\002//)";
    static char fmt_10090[] = "(t10,\002NO. OF SUPERPERIODS AND SYMMETRY \002,t50,i3,\002   \002,15i4,\002   \002)";
    static char fmt_10250[] = "(t10,\002NUMBER OF DIFFERENT BLOCKS\002,t50,i3/t10,\002BLOCKS PER PERIOD\002,t49,i5//)";
    static char fmt_10100[] = "(//131(\002-\002)//t30,\002BLOCKSTRUCTURE:\002/t30,\002(BLOCKTYP--NO. OF SINGLE ELEMENTS--SINGLE ELEMENT TYPES)\002//)";
    static char fmt_10260[] = "(t4,i3,1x,a16,1x,i2,1x,6(1x,a16))";
    static char fmt_10270[] = "(t28,6(1x,a16))";
    static char fmt_10120[] = "(//131(\002-\002)//t30,\002BLOCKSTRUCTURE OF SUPERPERIOD:\002//)";
    static char fmt_10280[] = "(t3,i6,1x,5(a16,1x))";
    static char fmt_10140[] = "(\002 \002,t30,\002SYNCHROTRON OSCILLATIONS AND BEAM-BEAM\002//t10,\002NUMBER OF CAVITIES    \002,t76,i4/t10,\002MOMENTUM AMPLITUDE DP/P \002,t66,f14.9/t10,\002OFFSET MOMENTUM AMPLITUDE DP/P \002,t66,f14.9/t10,\002MACHINE LENGTH IN (M) \002,t63,f17.9/t10,\002PARTICLE MASS (MEV) \002,t66,f14.9/t10,\002PARTICLE NUMBER \002,t66,1pe14.7/t10,\002BEAMS HAVE SAME CHARGE\002/t10,\002CLOSED ORBIT DUE TO BEAM-BEAM KICK (0=LEFT,1=SUBTRACTED) : \002,t79,i1/t10,\002FAST BEAM-BEAM KICK SWITCH (0=OFF,1=ON) : \002,t79,i1/t10,\002NORMALIZED HORIZONTAL EMMITTANCE (mu-meter rad)\002,t71,0pf9.4/t10,\002NORMALIZED VERTICAL EMMITTANCE (mu-meter rad)\002,t71,f9.4/t10,\002ENERGY IN (MEV)\002,t66,f14.3/t10,\002DPS CORR.-FACTOR           \002,t66,f14.9/t10,\002SIG CORR.-FACTOR           \002,t66,f14.9)";
    static char fmt_10141[] = "(\002 \002,t30,\002SYNCHROTRON OSCILLATIONS AND BEAM-BEAM\002//t10,\002NUMBER OF CAVITIES    \002,t76,i4/t10,\002MOMENTUM AMPLITUDE DP/P \002,t66,f14.9/t10,\002OFFSET MOMENTUM AMPLITUDE DP/P \002,t66,f14.9/t10,\002MACHINE LENGTH IN (M) \002,t63,f17.9/t10,\002PARTICLE MASS (MEV) \002,t66,f14.9/t10,\002PARTICLE NUMBER \002,t66,1pe14.7/t10,\002BEAMS HAVE OPPOSITE CHARGE\002/t10,\002CLOSED ORBIT DUE TO BEAM-BEAM KICK (0=LEFT,1=SUBTRACTED) : \002,t79,i1/t10,\002FAST BEAM-BEAM KICK SWITCH (0=OFF,1=ON) : \002,t79,i1/t10,\002NORMALIZED HORIZONTAL EMMITTANCE (mu-meter rad)\002,t71,0pf9.4/t10,\002NORMALIZED VERTICAL EMMITTANCE (mu-meter rad)\002,t71,f9.4/t10,\002ENERGY IN (MEV)\002,t66,f14.3/t10,\002DPS CORR.-FACTOR           \002,t66,f14.9/t10,\002SIG CORR.-FACTOR           \002,t66,f14.9)";
    static char fmt_10142[] = "(\002 \002,t30,\002SYNCHROTRON OSCILLATIONS\002//t10,\002NUMBER OF CAVITIES    \002,t76,i4/t10,\002MOMENTUM AMPLITUDE DP/P \002,t66,f14.9/t10,\002OFFSET MOMENTUM AMPLITUDE DP/P \002,t66,f14.9/t10,\002MACHINE LENGTH IN (M) \002,t63,f17.9/t10,\002PARTICLE MASS (MEV) \002,t66,f14.9/t10,\002ENERGY IN (MEV)\002,t66,f14.3/t10,\002DPS CORR.-FACTOR           \002,t66,f14.9/t10,\002SIG CORR.-FACTOR           \002,t66,f14.9)";
    static char fmt_10143[] = "(t10,\002HARMONIC NUMBER\002,t74,f6.0/t10,\002CIRCUMF. VOLTAGE   (MV)\002,t66,f14.9/t10,\002EQUILIBRIUM PHASE     (DEG)\002,t66,f14.9/t10,\002FREQUENCY (IN UNITS OF REVOLUTION-FREQ.) QS-LINEAR\002,t66,f14.9/t10,\002MOMENTUM COMPACTION\002,t66,f14.9/)";
    static char fmt_10150[] = "(\002 \002//t43,\002*** TRACKING PARAMETERS ***\002/)";
    static char fmt_10160[] = "(t10,\002NUMBER OF REVOLUTIONS  \002,t48,i8/t10,\002NUMBER OF REVERSE-REVOLUTIONS\002,t48,i8/t10,\002TURNS PER COOR.-PRINTOUT\002,t48,i8/t10,\002FLAT BOTTOM UP TO TURN \002,t48,i8/t10,\002TURNS PER PRINT ON DATASET\002,t48,i8/t10,\002ACCELERATION UP TO TURN\002,t48,i8/t10,\002TURNS PER PRINT ON DATASET\002,t48,i8/t10,\002FLAT TOP NUMBER OF TURNS\002,t48,i8/t10,\002TURNS PER PRINT ON DATASET\002,t48,i8/t10,\002TRACKING START AT ELEMENT NO.\002,t48,i8/t10,\002INITIAL AMPLITUDE-H IN (MM)\002,t49,f7.3/t10,\002COUPLING  EPS-Z/EPS-X\002,t49,f7.3/t10,\002NUMBER OF C.-O. ITERATIONS \002,t48,i8/t10,\002PRECISION OF C.-O. DEVIATION\002,t47,d9.3/t10,\002PRECISION OF C.-O. SLOPE   \002,t47,d9.3/t10,\002NUMBER OF Q-ADJ. ITERATIONS\002,t48,i8/t10,\002CHANGE IN K-STRENGTH BY\002,t47,d9.3/t10,\002PRECISION OF Q-ADJUSTEMENT\002,t47,d9.3)";
    static char fmt_10170[] = "(t10,\002NUMBER OF CHROMAT.-ADJ. ITER.\002,t48,i8/t10,\002CHANGE IN SEX.-STRENGTH BY\002,t47,d9.3/t10,\002PRECISION OF CHROMAT.-ADJ.\002,t47,d9.3/t10,\002DP-INTERVAL F. CROMAT.-ADJ.\002,t47,d9.3/t10,\002DP-INTERVAL FOR DISPERSION\002,t47,d9.3/t10,\002PRECISION FOR C.-O. RMS\002,t47,d9.3/)";
    static char fmt_10230[] = "(//131(\002-\002)//t10,\002DATA BLOCK RIPPLE OF POWER SUPPLIES\002//t10,\002ELEMENT\002,6x,\002AMPLITUDE\002,9x,\002FREQUENCY\002,9x,\002STARTPHASE\002,9x,\002INI. TURNNUMBER\002/t10,62(\002-\002)/)"
	    ;
    static char fmt_10240[] = "(t10,a16,3(2x,d16.10),2x,i10)";
    static char fmt_10040[] = "(t10,21(\002o\002)/t10,2(\002o\002),17x,2(\002o\002)/t10,\002OO  PREPROCESSING  OO\002,/t10,2(\002o\002),17x,2(\002o\002)/t10,21(\002o\002))";

     
    address a__1[2];
    integer i__1, i__2[2], i__3, i__4;
    doublereal d__1, d__2;
    alist al__1;

     
      int s_copy();
    integer s_rsfe(), do_fio(), e_rsfe(), s_cmp(), s_wsfe(), e_wsfe(), s_rsle(
	    ), do_lio(), e_rsle();
      int s_cat();
    integer f_rew(), s_wsle(), e_wsle();
    double cos(), sqrt();

     
    static integer i__, j, k, l, m, j0, k0, i2, j1, j2, i1, l1, l2;
    static doublereal r0;
    static integer l3, l4;
    static doublereal u0;
    static integer ia;
    static char ch[80];
    static integer ka;
    static doublereal rv;
    static integer im, ke, ii, jj, iw, ix, ll, ki, kk, k10, k11;
    static char ic0[16*10], ch1[160];
    static doublereal r0a;
    static integer il1, iw0;
    static char bez0[16*700], imn[16], iss[16*2], iqq[16*5], beze[16*300*100],
	     idat[16], icel[16*100*20], irel[16], iele[16], ilm[16*100], ilm0[
	    16*40], ihead[60];
    extern   int error_();
    static integer nbidu, iclr, icy, ncy2, ndum;
    static doublereal harm, alc, phag;
    static integer mout, mout1, mout3, mout4, imod;
    static doublereal xpl0, xrms0, zpl0, zrms0;
    static integer idi;
    static doublereal pmat, halc, halc2, cosy, qigam, qbet, halc3;
    static char bezext[16*20000];
    extern   int intepr_();
    static doublereal extaux[40], bk0d, bkad, ak0d, akad;
    extern   int recuin_(), ranecu_();
    static doublereal rsum, rmean, rsqsum, rdev;
    static integer iexnum, ifiend8;
    static doublereal alignx, alignz, tilt;
    static integer izu, kpz, kzz;
    static doublereal dummy;
    static integer imo;
    static doublereal apxx, apzz;
    static integer ico;
    static doublereal ram, rfr, rph;
    extern   int wzset_();
    static integer mblozz, icc, nfb, nac, nft, ifiend16, iexread, irecuin;

     
    static cilist io___367 = { 1, 3, 1, fmt_10010, 0 };
    static cilist io___370 = { 0, 6, 0, fmt_10130, 0 };
    static cilist io___371 = { 0, 6, 0, fmt_10030, 0 };
    static cilist io___372 = { 0, 6, 0, fmt_10180, 0 };
    static cilist io___373 = { 0, 6, 0, fmt_10190, 0 };
    static cilist io___374 = { 0, 6, 0, fmt_10200, 0 };
    static cilist io___375 = { 0, 6, 0, fmt_10130, 0 };
    static cilist io___376 = { 1, 2, 1, fmt_10000, 0 };
    static cilist io___377 = { 1, 3, 1, fmt_10000, 0 };
    static cilist io___378 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___380 = { 1, 2, 1, fmt_10020, 0 };
    static cilist io___381 = { 1, 2, 1, fmt_10000, 0 };
    static cilist io___383 = { 0, 11, 0, 0, 0 };
    static cilist io___384 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___389 = { 0, 11, 0, 0, 0 };
    static cilist io___390 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___391 = { 1, 2, 1, fmt_10020, 0 };
    static cilist io___392 = { 1, 11, 0, 0, 0 };
    static cilist io___393 = { 0, 11, 0, 0, 0 };
    static cilist io___396 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___397 = { 1, 2, 1, fmt_10020, 0 };
    static cilist io___398 = { 1, 2, 1, fmt_10000, 0 };
    static cilist io___399 = { 0, 11, 0, 0, 0 };
    static cilist io___404 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___405 = { 1, 2, 1, fmt_10020, 0 };
    static cilist io___410 = { 1, 11, 0, 0, 0 };
    static cilist io___411 = { 0, 11, 0, 0, 0 };
    static cilist io___415 = { 0, 11, 0, 0, 0 };
    static cilist io___416 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___417 = { 1, 11, 0, 0, 0 };
    static cilist io___418 = { 0, 11, 0, 0, 0 };
    static cilist io___419 = { 0, 11, 0, 0, 0 };
    static cilist io___420 = { 0, 11, 0, 0, 0 };
    static cilist io___421 = { 0, 11, 0, 0, 0 };
    static cilist io___422 = { 0, 11, 0, 0, 0 };
    static cilist io___423 = { 0, 11, 0, 0, 0 };
    static cilist io___424 = { 0, 11, 0, 0, 0 };
    static cilist io___425 = { 0, 11, 0, 0, 0 };
    static cilist io___426 = { 0, 11, 0, 0, 0 };
    static cilist io___427 = { 0, 11, 0, 0, 0 };
    static cilist io___428 = { 0, 11, 0, 0, 0 };
    static cilist io___429 = { 0, 11, 0, 0, 0 };
    static cilist io___430 = { 0, 11, 0, 0, 0 };
    static cilist io___431 = { 0, 11, 0, 0, 0 };
    static cilist io___432 = { 0, 11, 0, 0, 0 };
    static cilist io___433 = { 0, 11, 0, 0, 0 };
    static cilist io___434 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___435 = { 1, 11, 0, 0, 0 };
    static cilist io___436 = { 0, 11, 0, 0, 0 };
    static cilist io___437 = { 0, 11, 0, 0, 0 };
    static cilist io___438 = { 0, 11, 0, 0, 0 };
    static cilist io___439 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___440 = { 1, 11, 0, 0, 0 };
    static cilist io___441 = { 0, 11, 0, 0, 0 };
    static cilist io___442 = { 0, 11, 0, 0, 0 };
    static cilist io___445 = { 0, 6, 0, 0, 0 };
    static cilist io___446 = { 0, 6, 0, 0, 0 };
    static cilist io___447 = { 0, 6, 0, 0, 0 };
    static cilist io___448 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___449 = { 0, 11, 0, 0, 0 };
    static cilist io___450 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___451 = { 0, 6, 0, fmt_10370, 0 };
    static cilist io___452 = { 0, 11, 0, 0, 0 };
    static cilist io___453 = { 0, 11, 0, 0, 0 };
    static cilist io___454 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___455 = { 0, 11, 0, 0, 0 };
    static cilist io___456 = { 0, 6, 0, fmt_10370, 0 };
    static cilist io___457 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___458 = { 0, 11, 0, 0, 0 };
    static cilist io___459 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___460 = { 0, 11, 0, 0, 0 };
    static cilist io___461 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___462 = { 1, 11, 0, 0, 0 };
    static cilist io___463 = { 0, 11, 0, 0, 0 };
    static cilist io___465 = { 0, 11, 0, 0, 0 };
    static cilist io___467 = { 0, 6, 0, 0, 0 };
    static cilist io___468 = { 0, 6, 0, 0, 0 };
    static cilist io___469 = { 0, 6, 0, 0, 0 };
    static cilist io___470 = { 0, 6, 0, fmt_10130, 0 };
    static cilist io___471 = { 0, 6, 0, fmt_10340, 0 };
    static cilist io___479 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___480 = { 0, 11, 0, 0, 0 };
    static cilist io___484 = { 0, 6, 0, fmt_10130, 0 };
    static cilist io___485 = { 0, 6, 0, fmt_10210, 0 };
    static cilist io___490 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___491 = { 1, 11, 0, 0, 0 };
    static cilist io___492 = { 0, 11, 0, 0, 0 };
    static cilist io___493 = { 0, 6, 0, fmt_10220, 0 };
    static cilist io___494 = { 0, 6, 0, fmt_10380, 0 };
    static cilist io___495 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___496 = { 1, 11, 0, 0, 0 };
    static cilist io___497 = { 0, 11, 0, 0, 0 };
    static cilist io___502 = { 0, 6, 0, fmt_10410, 0 };
    static cilist io___503 = { 0, 6, 0, fmt_10430, 0 };
    static cilist io___504 = { 0, 6, 0, fmt_10440, 0 };
    static cilist io___505 = { 0, 6, 0, fmt_10130, 0 };
    static cilist io___506 = { 0, 6, 0, 0, 0 };
    static cilist io___507 = { 0, 6, 0, 0, 0 };
    static cilist io___508 = { 0, 6, 0, 0, 0 };
    static cilist io___512 = { 0, 16, 1, fmt_10020, 0 };
    static cilist io___513 = { 1, 16, 1, fmt_10020, 0 };
    static cilist io___514 = { 0, 11, 0, 0, 0 };
    static cilist io___516 = { 1, 16, 1, 0, 0 };
    static cilist io___517 = { 1, 16, 1, 0, 0 };
    static cilist io___518 = { 1, 16, 1, 0, 0 };
    static cilist io___519 = { 1, 16, 1, 0, 0 };
    static cilist io___520 = { 1, 16, 1, 0, 0 };
    static cilist io___521 = { 1, 16, 1, 0, 0 };
    static cilist io___522 = { 1, 16, 1, 0, 0 };
    static cilist io___523 = { 1, 16, 1, 0, 0 };
    static cilist io___524 = { 1, 16, 1, 0, 0 };
    static cilist io___525 = { 1, 16, 1, 0, 0 };
    static cilist io___526 = { 1, 16, 1, 0, 0 };
    static cilist io___527 = { 1, 16, 1, 0, 0 };
    static cilist io___528 = { 1, 16, 1, 0, 0 };
    static cilist io___529 = { 1, 16, 1, 0, 0 };
    static cilist io___530 = { 0, 6, 0, 0, 0 };
    static cilist io___531 = { 0, 6, 0, 0, 0 };
    static cilist io___532 = { 0, 6, 0, 0, 0 };
    static cilist io___533 = { 0, 6, 0, 0, 0 };
    static cilist io___534 = { 0, 6, 0, 0, 0 };
    static cilist io___536 = { 0, 8, 1, fmt_10020, 0 };
    static cilist io___537 = { 1, 8, 1, fmt_10020, 0 };
    static cilist io___538 = { 0, 11, 0, 0, 0 };
    static cilist io___542 = { 0, 6, 0, 0, 0 };
    static cilist io___543 = { 0, 6, 0, 0, 0 };
    static cilist io___545 = { 0, 30, 1, fmt_10020, 0 };
    static cilist io___548 = { 1, 30, 1, fmt_10020, 0 };
    static cilist io___549 = { 0, 11, 0, 0, 0 };
    static cilist io___550 = { 0, 6, 0, 0, 0 };
    static cilist io___551 = { 0, 6, 0, 0, 0 };
    static cilist io___552 = { 0, 6, 0, 0, 0 };
    static cilist io___553 = { 0, 6, 0, 0, 0 };
    static cilist io___554 = { 0, 6, 0, 0, 0 };
    static cilist io___555 = { 1, 30, 1, fmt_10020, 0 };
    static cilist io___556 = { 0, 11, 0, 0, 0 };
    static cilist io___558 = { 0, 6, 0, fmt_10130, 0 };
    static cilist io___559 = { 0, 6, 0, fmt_10350, 0 };
    static cilist io___560 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___561 = { 0, 11, 0, 0, 0 };
    static cilist io___562 = { 0, 6, 0, fmt_10360, 0 };
    static cilist io___563 = { 0, 6, 0, fmt_10390, 0 };
    static cilist io___564 = { 0, 6, 0, fmt_10400, 0 };
    static cilist io___568 = { 0, 6, 0, fmt_10130, 0 };
    static cilist io___569 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___570 = { 1, 11, 0, 0, 0 };
    static cilist io___571 = { 0, 11, 0, 0, 0 };
    static cilist io___572 = { 0, 11, 0, 0, 0 };
    static cilist io___573 = { 0, 11, 0, 0, 0 };
    static cilist io___574 = { 0, 11, 0, 0, 0 };
    static cilist io___575 = { 0, 6, 0, fmt_10320, 0 };
    static cilist io___576 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___579 = { 0, 11, 0, 0, 0 };
    static cilist io___581 = { 0, 6, 0, fmt_10330, 0 };
    static cilist io___582 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___583 = { 1, 11, 0, 0, 0 };
    static cilist io___584 = { 0, 11, 0, 0, 0 };
    static cilist io___585 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___587 = { 0, 11, 0, 0, 0 };
    static cilist io___589 = { 0, 6, 0, fmt_10130, 0 };
    static cilist io___590 = { 0, 6, 0, fmt_10300, 0 };
    static cilist io___591 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___592 = { 0, 11, 0, 0, 0 };
    static cilist io___594 = { 0, 6, 0, fmt_10310, 0 };
    static cilist io___595 = { 0, 6, 0, fmt_10290, 0 };
    static cilist io___596 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___597 = { 1, 11, 0, 0, 0 };
    static cilist io___598 = { 0, 11, 0, 0, 0 };
    static cilist io___599 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___600 = { 1, 11, 0, 0, 0 };
    static cilist io___601 = { 0, 11, 0, 0, 0 };
    static cilist io___602 = { 0, 11, 0, 0, 0 };
    static cilist io___603 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___604 = { 1, 11, 0, 0, 0 };
    static cilist io___605 = { 0, 11, 0, 0, 0 };
    static cilist io___606 = { 0, 11, 0, 0, 0 };
    static cilist io___607 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___608 = { 1, 11, 0, 0, 0 };
    static cilist io___609 = { 0, 11, 0, 0, 0 };
    static cilist io___610 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___611 = { 0, 11, 0, 0, 0 };
    static cilist io___612 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___613 = { 0, 11, 0, 0, 0 };
    static cilist io___614 = { 0, 11, 0, 0, 0 };
    static cilist io___615 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___616 = { 0, 11, 0, 0, 0 };
    static cilist io___617 = { 0, 11, 0, 0, 0 };
    static cilist io___618 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___619 = { 1, 11, 0, 0, 0 };
    static cilist io___620 = { 0, 11, 0, 0, 0 };
    static cilist io___621 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___622 = { 1, 11, 0, 0, 0 };
    static cilist io___623 = { 0, 11, 0, 0, 0 };
    static cilist io___624 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___625 = { 0, 11, 0, 0, 0 };
    static cilist io___627 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___628 = { 1, 11, 0, 0, 0 };
    static cilist io___629 = { 0, 11, 0, 0, 0 };
    static cilist io___630 = { 0, 11, 0, 0, 0 };
    static cilist io___631 = { 0, 11, 0, 0, 0 };
    static cilist io___632 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___633 = { 0, 11, 0, 0, 0 };
    static cilist io___637 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___638 = { 0, 11, 0, 0, 0 };
    static cilist io___639 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___640 = { 0, 11, 0, 0, 0 };
    static cilist io___641 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___642 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___643 = { 0, 6, 0, fmt_10130, 0 };
    static cilist io___644 = { 0, 6, 0, 0, 0 };
    static cilist io___645 = { 1, 11, 0, 0, 0 };
    static cilist io___646 = { 0, 11, 0, 0, 0 };
    static cilist io___647 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___648 = { 1, 11, 0, 0, 0 };
    static cilist io___649 = { 0, 11, 0, 0, 0 };
    static cilist io___650 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___651 = { 0, 11, 0, 0, 0 };
    static cilist io___652 = { 0, 3, 0, 0, 0 };
    static cilist io___653 = { 0, 3, 0, 0, 0 };
    static cilist io___654 = { 1, 3, 1, fmt_10020, 0 };
    static cilist io___655 = { 1, 11, 0, 0, 0 };
    static cilist io___656 = { 0, 11, 0, 0, 0 };
    static cilist io___657 = { 0, 6, 0, fmt_10050, 0 };
    static cilist io___658 = { 0, 6, 0, fmt_10060, 0 };
    static cilist io___660 = { 0, 6, 0, fmt_10070, 0 };
    static cilist io___661 = { 0, 6, 0, fmt_10070, 0 };
    static cilist io___662 = { 0, 6, 0, fmt_10130, 0 };
    static cilist io___663 = { 0, 6, 0, fmt_10080, 0 };
    static cilist io___664 = { 0, 6, 0, fmt_10090, 0 };
    static cilist io___665 = { 0, 6, 0, fmt_10250, 0 };
    static cilist io___666 = { 0, 6, 0, fmt_10100, 0 };
    static cilist io___671 = { 0, 6, 0, fmt_10260, 0 };
    static cilist io___672 = { 0, 6, 0, fmt_10270, 0 };
    static cilist io___674 = { 0, 6, 0, fmt_10270, 0 };
    static cilist io___675 = { 0, 6, 0, fmt_10260, 0 };
    static cilist io___676 = { 0, 6, 0, fmt_10120, 0 };
    static cilist io___681 = { 0, 6, 0, fmt_10280, 0 };
    static cilist io___682 = { 0, 6, 0, fmt_10130, 0 };
    static cilist io___683 = { 0, 6, 0, fmt_10140, 0 };
    static cilist io___684 = { 0, 6, 0, fmt_10141, 0 };
    static cilist io___685 = { 0, 6, 0, fmt_10142, 0 };
    static cilist io___686 = { 0, 6, 0, fmt_10143, 0 };
    static cilist io___687 = { 0, 6, 0, 0, 0 };
    static cilist io___688 = { 0, 6, 0, fmt_10130, 0 };
    static cilist io___689 = { 0, 6, 0, fmt_10150, 0 };
    static cilist io___693 = { 0, 6, 0, fmt_10160, 0 };
    static cilist io___694 = { 0, 6, 0, fmt_10170, 0 };
    static cilist io___695 = { 0, 6, 0, fmt_10230, 0 };
    static cilist io___696 = { 0, 6, 0, fmt_10240, 0 };
    static cilist io___697 = { 0, 6, 0, fmt_10130, 0 };
    static cilist io___698 = { 0, 6, 0, fmt_10040, 0 };
    static cilist io___699 = { 0, 6, 0, fmt_10130, 0 };


 

 
 

 

    if ((0) ) {
	error_(&c__85);
    }
    irecuin = 0;
    s_copy(iss, " ", 16L, 1L);
    s_copy(iss + 16, " ", 16L, 1L);
    for (i__ = 1; i__ <= 5; ++i__) {
	s_copy(iqq + (i__ - 1 << 4), " ", 16L, 1L);
 
    }
    for (i__ = 1; i__ <= 700; ++i__) {
	s_copy(bez0 + (i__ - 1 << 4), " ", 16L, 1L);
 
    }
    for (i__ = 1; i__ <= 300; ++i__) {
	for (j = 1; j <= 100; ++j) {
	    s_copy(beze + (i__ + j * 300 - 301 << 4), " ", 16L, 1L);
 
	}
    }
    for (i__ = 1; i__ <= 40; ++i__) {
	s_copy(ilm0 + (i__ - 1 << 4), " ", 16L, 1L);
	extaux[i__ - 1] = 0.;
 
    }
    for (i__ = 1; i__ <= 10; ++i__) {
	s_copy(tcorrc_ .coel + (i__ - 1 << 4), " ", 16L, 1L);
 
    }
    for (i__ = 1; i__ <= 100; ++i__) {
	for (j = 1; j <= 20; ++j) {
	    s_copy(icel + (i__ + j * 100 - 101 << 4), " ", 16L, 1L);
 
	}
    }
    for (i__ = 1; i__ <= 10; ++i__) {
	s_copy(ic0 + (i__ - 1 << 4), " ", 16L, 1L);
 
    }
    for (i__ = 1; i__ <= 100; ++i__) {
	s_copy(ilm + (i__ - 1 << 4), " ", 16L, 1L);
 
    }
    s_copy(ihead, " ", 60L, 1L);
    s_copy(titc_ .sixtit, " ", 80L, 1L);
    nbidu = 0;
    tra1_ .iclo6 = 0;
    tra1_ .iclo6r = 0;
    iclr = 0;
    icy = 0;
    syn_ .ncy = 0;
    ncy2 = 0;
    dial_ .nsix = 0;
    dial_ .ncor = 0;
    dial_ .nvar2 = 0;
    ndum = 0;
    tra1_ .numl = 1;
    tra1_ .napx = 0;
    (tra_._1) .amp[0] = .001;
    qmodi_ .amp0 = 0.;
    tra1_ .ird = 0;
    tra1_ .imc = 0;
    dial_ .idial = 0;
    syos_ .idz[0] = 1;
    syos_ .idz[1] = 1;
    tra1_ .idfor = 0;
    tra1_ .irew = 0;
    tra1_ .nde[0] = 0;
    tra1_ .nde[1] = 0;
    tra1_ .nwr[0] = 1;
    tra1_ .nwr[1] = 1;
    tra1_ .nwr[2] = 1;
    tra1_ .nwr[3] = 10000;
    tra1_ .ntwin = 1;
    harm = 1.;
    alc = .001;
    phag = 0.;
    syn_ .tlen = 1.;
    syn_ .pma = 938.2723128;
    syn_ .ition = 0;
    cor_ .dpscor = 1.;
    cor_ .sigcor = 1.;
    postr_ .iconv = 0;
    postr_ .imad = 0;
    postr_ .iskip = 1;
    postr_ .cma1 = 1.;
    postr_ .cma2 = 1.;
    syn_ .qs = 0.;
    anf_ .itra = 0;
    anf_ .chi0 = 0.;
    anf_ .chid = 0.;
    tra1_ .rat = 0.;
    rv = 1.;
    posti1_ .ipos = 0;
    posti1_ .iav = 1;
    postr_ .nstart = 0;
    postr_ .nstop = 0;
    posti1_ .iwg = 1;
    postr_ .dphix = 0.;
    postr_ .dphiz = 0.;
    postr_ .qx0 = 0.;
    postr_ .qz0 = 0.;
    posti1_ .ivox = 1;
    posti1_ .ivoz = 1;
    posti1_ .ires = 1;
    postr_ .dres = 1.;
    posti1_ .ifh = 0;
    postr_ .dfft = 1.;
    posti2_ .kwtype = 7878;
    posti2_ .itf = 0;
    posti2_ .icr = 0;
    posti2_ .idis = 0;
    posti2_ .icow = 0;
    posti2_ .istw = 0;
    posti2_ .iffw = 0;
    posti2_ .nprint = 1;
    posti2_ .ndafi = 1;
    clo_ .itco = 50;
    clo_ .dma = 1e-12;
    clo_ .dmap = 1e-15;
    clo_ .itcro = 10;
    clo_ .dech = 1e-10;
    clo_ .de0 = 1e-9;
    clo_ .ded = 1e-9;
    clo_ .dsi = 1e-9;
    clo_ .dsm0 = 1e-10;
    clo_ .itqv = 10;
    clo_ .dkq = 1e-10;
    clo_ .dqq = 1e-10;
    (chrom_._1) .ichrom = 0;
    qmodi_ .iqmod = 0;
    im = 0;
    linop_ .ilin = 0;
    linop_ .nlin = 0;
    clo_ .iout = 0;
    syn_ .idp = 0;
    rand0_ .izu0 = 0;
    rand0_ .mmac = 1;
    rand0_ .mcut = 0;
    mout = 0;
    mout1 = 0;
    rand1_ .mout2 = 0;
    mout3 = 0;
    mout4 = 0;
    str_ .kanf = 1;
    clos_ .iclo = 0;
    subres_ .isub = 0;
    secom_ .irmod2 = 0;
    rand0_ .iorg = 0;
    sea_ .ise = 0;
    ripp_ .irip = 0;
    ripp_ .irco = 0;
    skew_ .iskew = 0;
    dial_ .preda = 1e-38;
L90:
    erro_ .ierro = s_rsfe(&io___367);
    if (erro_ .ierro != 0) {
	goto L100001;
    }
    erro_ .ierro = do_fio(&c__1, idat, 16L);
    if (erro_ .ierro != 0) {
	goto L100001;
    }
    erro_ .ierro = do_fio(&c__1, ihead, 60L);
    if (erro_ .ierro != 0) {
	goto L100001;
    }
    erro_ .ierro = e_rsfe();
L100001:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)idat == '/') {
	goto L90;
    }
    if (s_cmp(idat, free, 16L, 16L) != 0 && s_cmp(idat, geom, 16L, 16L) != 0) 
	    {
	error_(&c__1);
    }
    imod = 1;
    if (s_cmp(idat, geom, 16L, 16L) == 0) {
	imod = 2;
    }
    s_wsfe(&io___370);
    e_wsfe();
    s_wsfe(&io___371);
    e_wsfe();
    s_wsfe(&io___372);
    do_fio(&c__1, ihead, 60L);
    e_wsfe();
    s_copy(titc_ .sixtit, ihead, 60L, 60L);
    if (imod == 1) {
	s_wsfe(&io___373);
	e_wsfe();
    }
    if (imod == 2) {
	s_wsfe(&io___374);
	e_wsfe();
    }
    s_wsfe(&io___375);
    e_wsfe();
    if (imod == 2) {
L100:
	erro_ .ierro = s_rsfe(&io___376);
	if (erro_ .ierro != 0) {
	    goto L100002;
	}
	erro_ .ierro = do_fio(&c__1, idat, 16L);
	if (erro_ .ierro != 0) {
	    goto L100002;
	}
	erro_ .ierro = e_rsfe();
L100002:
	if (erro_ .ierro < 0) {
	    goto L1520;
	}
	if (erro_ .ierro > 0) {
	    error_(&c__57);
	}
	if (*(unsigned char *)idat == '/') {
	    goto L100;
	}
	if (s_cmp(idat, sing, 16L, 16L) == 0) {
	    goto L120;
	}
	error_(&c__15);
    }
L110:
    erro_ .ierro = s_rsfe(&io___377);
    if (erro_ .ierro != 0) {
	goto L100003;
    }
    erro_ .ierro = do_fio(&c__1, idat, 16L);
    if (erro_ .ierro != 0) {
	goto L100003;
    }
    erro_ .ierro = e_rsfe();
L100003:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)idat == '/') {
	goto L110;
    }
    if (s_cmp(idat, sing, 16L, 16L) == 0) {
	goto L120;
    }
    if (s_cmp(idat, bloc, 16L, 16L) == 0) {
	goto L190;
    }
    if (s_cmp(idat, stru, 16L, 16L) == 0) {
	goto L320;
    }
    if (s_cmp(idat, prin, 16L, 16L) == 0) {
	goto L550;
    }
    if (s_cmp(idat, disp, 16L, 16L) == 0) {
	goto L170;
    }
    if (s_cmp(idat, tune, 16L, 16L) == 0) {
	goto L600;
    }
    if (s_cmp(idat, sync, 16L, 16L) == 0) {
	goto L710;
    }
    if (s_cmp(idat, iter, 16L, 16L) == 0) {
	goto L940;
    }
    if (s_cmp(idat, fluc, 16L, 16L) == 0) {
	goto L790;
    }
    if (s_cmp(idat, mult, 16L, 16L) == 0) {
	goto L740;
    }
    if (s_cmp(idat, chro, 16L, 16L) == 0) {
	goto L560;
    }
    if (s_cmp(idat, trac, 16L, 16L) == 0) {
	goto L510;
    }
    if (s_cmp(idat, diff, 16L, 16L) == 0) {
	goto L520;
    }
    if (s_cmp(idat, line, 16L, 16L) == 0) {
	goto L660;
    }
    if (s_cmp(idat, limi, 16L, 16L) == 0) {
	goto L950;
    }
    if (s_cmp(idat, orbi, 16L, 16L) == 0) {
	goto L980;
    }
    if (s_cmp(idat, init, 16L, 16L) == 0) {
	goto L500;
    }
    if (s_cmp(idat, comb, 16L, 16L) == 0) {
	goto L1030;
    }
    if (s_cmp(idat, subr, 16L, 16L) == 0) {
	goto L1110;
    }
    if (s_cmp(idat, reso, 16L, 16L) == 0) {
	goto L1120;
    }
    if (s_cmp(idat, sear, 16L, 16L) == 0) {
	goto L1200;
    }
    if (s_cmp(idat, orga, 16L, 16L) == 0) {
	goto L880;
    }
    if (s_cmp(idat, post, 16L, 16L) == 0) {
	goto L1280;
    }
    if (s_cmp(idat, ripp, 16L, 16L) == 0) {
	goto L1290;
    }
    if (s_cmp(idat, deco, 16L, 16L) == 0) {
	goto L1320;
    }
    if (s_cmp(idat, comm, 16L, 16L) == 0) {
	goto L1390;
    }
    if (s_cmp(idat, norm, 16L, 16L) == 0) {
	goto L1400;
    }
    if (s_cmp(idat, corr, 16L, 16L) == 0) {
	goto L1410;
    }
    if (s_cmp(idat, beam, 16L, 16L) == 0) {
	goto L1600;
    }
    if (s_cmp(idat, next, 16L, 16L) == 0) {
	goto L110;
    }
    if (s_cmp(idat, ende, 16L, 16L) == 0) {
	goto L771;
    }
    error_(&c__15);
 

 
 
 

L120:
    i__ = 1;
L130:
    if (imod == 1) {
L140:
	erro_ .ierro = s_rsfe(&io___378);
	if (erro_ .ierro != 0) {
	    goto L100004;
	}
	erro_ .ierro = do_fio(&c__1, ch, 80L);
	if (erro_ .ierro != 0) {
	    goto L100004;
	}
	erro_ .ierro = e_rsfe();
L100004:
	if (erro_ .ierro < 0) {
	    goto L1530;
	}
	if (erro_ .ierro > 0) {
	    error_(&c__58);
	}
	if (*(unsigned char *)ch == '/') {
	    goto L140;
	}
	if (s_cmp(ch, next, 4L, 16L) == 0) {
	    goto L110;
	}
    } else if (imod == 2) {
L150:
	erro_ .ierro = s_rsfe(&io___380);
	if (erro_ .ierro != 0) {
	    goto L100005;
	}
	erro_ .ierro = do_fio(&c__1, ch, 80L);
	if (erro_ .ierro != 0) {
	    goto L100005;
	}
	erro_ .ierro = e_rsfe();
L100005:
	if (erro_ .ierro < 0) {
	    goto L1520;
	}
	if (erro_ .ierro > 0) {
	    error_(&c__57);
	}
	if (*(unsigned char *)ch == '/') {
	    goto L150;
	}
	if (s_cmp(ch, next, 4L, 16L) == 0) {
L160:
	    erro_ .ierro = s_rsfe(&io___381);
	    if (erro_ .ierro != 0) {
		goto L100006;
	    }
	    erro_ .ierro = do_fio(&c__1, idat, 16L);
	    if (erro_ .ierro != 0) {
		goto L100006;
	    }
	    erro_ .ierro = e_rsfe();
L100006:
	    if (erro_ .ierro < 0) {
		goto L1520;
	    }
	    if (erro_ .ierro > 0) {
		error_(&c__57);
	    }
	    if (*(unsigned char *)idat == '/') {
		goto L160;
	    }
	    if (s_cmp(idat, bloc, 16L, 16L) != 0) {
		error_(&c__15);
	    }
	    goto L190;
	}
    }
    intepr_(&c__1, &c__1, ch, ch1, 80L, 160L);
    s_rsle(&io___383);
    do_lio(&c__9, &c__1, idat, 16L);
    do_lio(&c__3, &c__1, (char *)& ell_ .kz[i__ - 1], (ftnlen)sizeof(integer));
    do_lio(&c__5, &c__1, (char *)& ell_ .ed[i__ - 1], (ftnlen)sizeof(
	    doublereal));
    do_lio(&c__5, &c__1, (char *)& ell_ .ek[i__ - 1], (ftnlen)sizeof(
	    doublereal));
    do_lio(&c__5, &c__1, (char *)& ell_ .el[i__ - 1], (ftnlen)sizeof(
	    doublereal));
    e_rsle();
 
    if ((ell_ .kz[i__ - 1] == 4 || ell_ .kz[i__ - 1] == 5) && (d__1 = 
	    ell_ .el[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
	ell_ .ed[i__ - 1] = - ell_ .ed[i__ - 1];
    }
 
    if (ell_ .kz[i__ - 1] == 11 && (d__1 = ell_ .el[i__ - 1] + 1., (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) 
	    <= 1e-17) {
	dkic_ .dki[i__ - 1] = ell_ .ed[i__ - 1];
	dkic_ .dki[i__ + 1399] = ell_ .ek[i__ - 1];
	ell_ .ed[i__ - 1] = 1.;
	ell_ .ek[i__ - 1] = 1.;
	ell_ .el[i__ - 1] = 0.;
    } else if (ell_ .kz[i__ - 1] == 11 && (d__1 = ell_ .el[i__ - 1] + 2., (( 
	    d__1 ) >= 0 ? (  	    d__1 ) : -(  	    d__1 )) ) <= 1e-17) {
	dkic_ .dki[i__ + 699] = ell_ .ed[i__ - 1];
	dkic_ .dki[i__ + 1399] = ell_ .ek[i__ - 1];
	ell_ .ed[i__ - 1] = 1.;
	ell_ .ek[i__ - 1] = 1.;
	ell_ .el[i__ - 1] = 0.;
    }
 
    if ((i__1 = ell_ .kz[i__ - 1], (( i__1 ) >= 0 ? ( i__1 ) : -( i__1 )) ) == 12) {
	if ((d__1 = ell_ .ed[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17 && (d__2 = ell_ .ek[
		i__ - 1], (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) ) > 1e-17) {
	    ++ncy2;
	    syn_ .itionc[i__ - 1] = ell_ .kz[i__ - 1] / (i__1 = ell_ .kz[i__ 
		    - 1], (( i__1 ) >= 0 ? ( i__1 ) : -( i__1 )) );
	    ell_ .kp[i__ - 1] = 6;
	}
	syn_ .phasc[i__ - 1] = ell_ .el[i__ - 1];
	ell_ .el[i__ - 1] = 0.;
    }
 
    if ((i__1 = ell_ .kz[i__ - 1], (( i__1 ) >= 0 ? ( i__1 ) : -( i__1 )) ) == 20) {
	if ((d__1 = ell_ .ed[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) < 1e-12) {
	    ell_ .ed[i__ - 1] = 1e-12;
	}
	if ((d__1 = ell_ .ek[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) < 1e-12) {
	    ell_ .ek[i__ - 1] = 1e-12;
	}
    }
    if ((d__1 = ell_ .el[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17 && ell_ .kz[i__ - 1] != 
	    0) {
	tit_ .ithick = 1;
    }
    if (i__ > 699) {
	error_(&c__16);
    }
    if ((i__1 = ell_ .kz[i__ - 1], (( i__1 ) >= 0 ? ( i__1 ) : -( i__1 )) ) != 12) {
	ell_ .kp[i__ - 1] = 0;
    }
    s_copy(linopc_ .bez + (i__ - 1 << 4), idat, 16L, 16L);
    s_copy(bez0 + (i__ - 1 << 4), idat, 16L, 16L);
    if (ncy2 == 0) {
	++i__;
	str_ .il = i__;
	s_copy(linopc_ .bez + (i__ - 1 << 4), cavi, 16L, 16L);
	s_copy(bez0 + (i__ - 1 << 4), cavi, 16L, 16L);
	ell_ .kp[i__ - 1] = 6;
    } else {
	str_ .il = i__;
	++i__;
    }
    goto L130;
 

 
 

L170:
    erro_ .ierro = s_rsfe(&io___384);
    if (erro_ .ierro != 0) {
	goto L100007;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100007;
    }
    erro_ .ierro = e_rsfe();
L100007:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch == '/') {
	goto L170;
    }
    if (s_cmp(ch, next, 4L, 16L) == 0) {
	goto L110;
    }
    intepr_(&c__1, &c__1, ch, ch1, 80L, 160L);
    xpl0 = 0.;
    xrms0 = 0.;
    zpl0 = 0.;
    zrms0 = 0.;
    s_rsle(&io___389);
    do_lio(&c__9, &c__1, idat, 16L);
    do_lio(&c__5, &c__1, (char *)&xpl0, (ftnlen)sizeof(doublereal));
    do_lio(&c__5, &c__1, (char *)&xrms0, (ftnlen)sizeof(doublereal));
    do_lio(&c__5, &c__1, (char *)&zpl0, (ftnlen)sizeof(doublereal));
    do_lio(&c__5, &c__1, (char *)&zrms0, (ftnlen)sizeof(doublereal));
    e_rsle();
    i__1 = str_ .il;
    for (j = 1; j <= i__1; ++j) {
	if (s_cmp(idat, linopc_ .bez + (j - 1 << 4), 16L, 16L) != 0) {
	    goto L180;
	}
	pla_ .xpl[j - 1] = xpl0;
	pla_ .xrms[j - 1] = xrms0;
	pla_ .zpl[j - 1] = zpl0;
	pla_ .zrms[j - 1] = zrms0;
L180:
	;
    }
    goto L170;
 

 
 

L190:
    if (imod == 1) {
L200:
	erro_ .ierro = s_rsfe(&io___390);
	if (erro_ .ierro != 0) {
	    goto L100008;
	}
	erro_ .ierro = do_fio(&c__1, ch, 80L);
	if (erro_ .ierro != 0) {
	    goto L100008;
	}
	erro_ .ierro = e_rsfe();
L100008:
	if (erro_ .ierro < 0) {
	    goto L1530;
	}
	if (erro_ .ierro > 0) {
	    error_(&c__58);
	}
	if (*(unsigned char *)ch == '/') {
	    goto L200;
	}
    }
    if (imod == 2) {
L210:
	erro_ .ierro = s_rsfe(&io___391);
	if (erro_ .ierro != 0) {
	    goto L100009;
	}
	erro_ .ierro = do_fio(&c__1, ch, 80L);
	if (erro_ .ierro != 0) {
	    goto L100009;
	}
	erro_ .ierro = e_rsfe();
L100009:
	if (erro_ .ierro < 0) {
	    goto L1520;
	}
	if (erro_ .ierro > 0) {
	    error_(&c__57);
	}
	if (*(unsigned char *)ch == '/') {
	    goto L210;
	}
    }
 
    i__2[0] = 80, a__1[0] = ch;
    i__2[1] = 3, a__1[1] = " / ";
    s_cat(ch1, a__1, i__2, &c__2, 83L);
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    erro_ .ierro = s_wsle(&io___392);
    if (erro_ .ierro != 0) {
	goto L100010;
    }
    erro_ .ierro = do_lio(&c__9, &c__1, ch1, 160L);
    if (erro_ .ierro != 0) {
	goto L100010;
    }
    erro_ .ierro = e_wsle();
L100010:
    if (erro_ .ierro != 0) {
	error_(&c__59);
    }
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    s_rsle(&io___393);
    do_lio(&c__3, &c__1, (char *)& str_ .mper, (ftnlen)sizeof(integer));
    i__1 = str_ .mper;
    for (k = 1; k <= i__1; ++k) {
	do_lio(&c__3, &c__1, (char *)& str_ .msym[k - 1], (ftnlen)sizeof(
		integer));
    }
    e_rsle();
    if (str_ .mper > 16) {
	error_(&c__17);
    }
    i__ = 0;
L220:
    for (m = 1; m <= 40; ++m) {
 
	s_copy(ilm0 + (m - 1 << 4), idum, 16L, 16L);
    }
    if (imod == 1) {
L240:
	erro_ .ierro = s_rsfe(&io___396);
	if (erro_ .ierro != 0) {
	    goto L100011;
	}
	erro_ .ierro = do_fio(&c__1, ch, 80L);
	if (erro_ .ierro != 0) {
	    goto L100011;
	}
	erro_ .ierro = e_rsfe();
L100011:
	if (erro_ .ierro < 0) {
	    goto L1530;
	}
	if (erro_ .ierro > 0) {
	    error_(&c__58);
	}
	if (*(unsigned char *)ch == '/') {
	    goto L240;
	}
	if (s_cmp(ch, next, 4L, 16L) == 0) {
	    goto L110;
	}
    } else if (imod == 2) {
L250:
	erro_ .ierro = s_rsfe(&io___397);
	if (erro_ .ierro != 0) {
	    goto L100012;
	}
	erro_ .ierro = do_fio(&c__1, ch, 80L);
	if (erro_ .ierro != 0) {
	    goto L100012;
	}
	erro_ .ierro = e_rsfe();
L100012:
	if (erro_ .ierro < 0) {
	    goto L1520;
	}
	if (erro_ .ierro > 0) {
	    error_(&c__57);
	}
	if (*(unsigned char *)ch == '/') {
	    goto L250;
	}
	if (s_cmp(ch, next, 4L, 16L) == 0) {
L260:
	    erro_ .ierro = s_rsfe(&io___398);
	    if (erro_ .ierro != 0) {
		goto L100013;
	    }
	    erro_ .ierro = do_fio(&c__1, idat, 16L);
	    if (erro_ .ierro != 0) {
		goto L100013;
	    }
	    erro_ .ierro = e_rsfe();
L100013:
	    if (erro_ .ierro < 0) {
		goto L1520;
	    }
	    if (erro_ .ierro > 0) {
		error_(&c__57);
	    }
	    if (*(unsigned char *)idat == '/') {
		goto L260;
	    }
	    if (s_cmp(idat, stru, 16L, 16L) != 0) {
		error_(&c__15);
	    }
	    goto L320;
	}
    }
    intepr_(&c__2, &c__1, ch, ch1, 80L, 160L);
    s_rsle(&io___399);
    do_lio(&c__9, &c__1, idat, 16L);
    for (m = 1; m <= 40; ++m) {
	do_lio(&c__9, &c__1, ilm0 + (m - 1 << 4), 16L);
    }
    e_rsle();
    if (s_cmp(idat, idum, 16L, 16L) == 0) {
	goto L270;
    }
    ++i__;
    if (i__ > 299) {
	error_(&c__18);
    }
    s_copy(linopc_ .bezb + (i__ - 1 << 4), idat, 16L, 16L);
    k0 = 0;
    str_ .mblo = i__;
L270:
    ka = k0 + 1;
    ke = k0 + 40;
    i__1 = ke;
    for (l = ka; l <= i__1; ++l) {
	if (l > 100) {
	    error_(&c__26);
	}
	s_copy(ilm + (l - 1 << 4), ilm0 + (l - k0 - 1 << 4), 16L, 16L);
	if (s_cmp(ilm + (l - 1 << 4), idum, 16L, 16L) == 0) {
	    goto L310;
	}
	str2_ .mel[i__ - 1] = l;
	s_copy(beze + (i__ + l * 300 - 301 << 4), ilm + (l - 1 << 4), 16L, 
		16L);
	i__3 = str_ .il;
	for (j = 1; j <= i__3; ++j) {
	    if (s_cmp(bez0 + (j - 1 << 4), ilm + (l - 1 << 4), 16L, 16L) == 0)
		     {
		goto L290;
	    }
 
	}
	s_copy(erroc_ .erbez, ilm + (l - 1 << 4), 16L, 16L);
	error_(&c__19);
L290:
	str2_ .mtyp[i__ + l * 300 - 301] = j;
	if (ell_ .kz[j - 1] != 8) {
	    linop_ .elbe[i__ - 1] += ell_ .el[j - 1];
	}
 
    }
L310:
    k0 = l - 1;
    goto L220;
 

 
 

L320:
    i__ = 0;
L330:
    for (k = 1; k <= 40; ++k) {
 
	s_copy(ilm0 + (k - 1 << 4), idum, 16L, 16L);
    }
    if (imod == 1) {
L350:
	erro_ .ierro = s_rsfe(&io___404);
	if (erro_ .ierro != 0) {
	    goto L100014;
	}
	erro_ .ierro = do_fio(&c__1, ch, 80L);
	if (erro_ .ierro != 0) {
	    goto L100014;
	}
	erro_ .ierro = e_rsfe();
L100014:
	if (erro_ .ierro < 0) {
	    goto L1530;
	}
	if (erro_ .ierro > 0) {
	    error_(&c__58);
	}
	if (*(unsigned char *)ch == '/') {
	    goto L350;
	}
    }
    if (imod == 2) {
L360:
	erro_ .ierro = s_rsfe(&io___405);
	if (erro_ .ierro != 0) {
	    goto L100015;
	}
	erro_ .ierro = do_fio(&c__1, ch, 80L);
	if (erro_ .ierro != 0) {
	    goto L100015;
	}
	erro_ .ierro = e_rsfe();
L100015:
	if (erro_ .ierro < 0) {
	    goto L1520;
	}
	if (erro_ .ierro > 0) {
	    error_(&c__57);
	}
	if (*(unsigned char *)ch == '/') {
	    goto L360;
	}
    }
    if (s_cmp(ch, next, 4L, 16L) == 0) {
	goto L110;
    }
    i2 = 1;
    for (ii = 1; ii <= 80; ++ii) {
	if (s_cmp(ch + (ii - 1), kl, 1L, 16L) == 0) {
	    if (ii > 1) {
		i__1 = ii - 1;
		for (jj = 1; jj <= i__1; ++jj) {
 
		    if (*(unsigned char *)&ch[jj - 1] != ' ') {
			goto L380;
		    }
		}
	    }
	    iw = 1;
	    goto L390;
L380:
	    al__1.aerr = 0;
	    al__1.aunit = 11;
	    f_rew(&al__1);
	    erro_ .ierro = s_wsle(&io___410);
	    if (erro_ .ierro != 0) {
		goto L100016;
	    }
	    erro_ .ierro = do_lio(&c__9, &c__1, ch, ii - 1);
	    if (erro_ .ierro != 0) {
		goto L100016;
	    }
	    erro_ .ierro = e_wsle();
L100016:
	    if (erro_ .ierro != 0) {
		error_(&c__59);
	    }
	    al__1.aerr = 0;
	    al__1.aunit = 11;
	    f_rew(&al__1);
	    s_rsle(&io___411);
	    do_lio(&c__3, &c__1, (char *)&iw, (ftnlen)sizeof(integer));
	    e_rsle();
L390:
	    ia = i__;
	    iw0 = iw - 1;
	    i2 = ii + 1;
	    goto L430;
	}
	if (s_cmp(ch + (ii - 1), kr, 1L, 16L) == 0) {
	    if (iw0 <= 0) {
		goto L330;
	    }
	    idi = i__ - ia;
	    i__1 = iw0;
	    for (k = 1; k <= i__1; ++k) {
		i__3 = idi;
		for (j = 1; j <= i__3; ++j) {
 
		    str_ .ic[i__ + j - 1] = str_ .ic[i__ + j - idi - 1];
		}
		i__ += idi;
 
	    }
	    str_ .mbloz = i__;
	    goto L330;
	}
 
    }
L430:
    intepr_(&c__3, &i2, ch, ch1, 80L, 160L);
    s_rsle(&io___415);
    for (k = 1; k <= 40; ++k) {
	do_lio(&c__9, &c__1, ilm0 + (k - 1 << 4), 16L);
    }
    e_rsle();
    for (k = 1; k <= 40; ++k) {
	if (s_cmp(ilm0 + (k - 1 << 4), idum, 16L, 16L) == 0) {
	    goto L490;
	}
	if (s_cmp(ilm0 + (k - 1 << 4), go, 16L, 16L) == 0) {
	    goto L480;
	}
	++i__;
	i__1 = str_ .mblo;
	for (j = 1; j <= i__1; ++j) {
	    if (s_cmp(linopc_ .bezb + (j - 1 << 4), ilm0 + (k - 1 << 4), 16L, 
		    16L) == 0) {
		goto L470;
	    }
 
	}
	i__1 = str_ .il;
	for (l = 1; l <= i__1; ++l) {
	    if (s_cmp(bez0 + (l - 1 << 4), ilm0 + (k - 1 << 4), 16L, 16L) == 
		    0) {
		goto L460;
	    }
 
	}
	s_copy(erroc_ .erbez, ilm0 + (k - 1 << 4), 16L, 16L);
	error_(&c__20);
L460:
	str_ .ic[i__ - 1] = l + 300;
	if (s_cmp(bez0 + (l - 1 << 4), cavi, 16L, 16L) == 0) {
	    ++icy;
	}
	goto L490;
L470:
	str_ .ic[i__ - 1] = j;
	goto L490;
L480:
	str_ .kanf = i__ + 1;
L490:
	;
    }
    str_ .mbloz = i__;
    if (str_ .mbloz > 19998) {
	error_(&c__21);
    }
    goto L330;
 

 
 

L500:
    erro_ .ierro = s_rsfe(&io___416);
    if (erro_ .ierro != 0) {
	goto L100017;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100017;
    }
    erro_ .ierro = e_rsfe();
L100017:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch != '/') {
	++iclr;
    } else {
	goto L500;
    }
 
    i__2[0] = 80, a__1[0] = ch;
    i__2[1] = 3, a__1[1] = " / ";
    s_cat(ch1, a__1, i__2, &c__2, 83L);
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    erro_ .ierro = s_wsle(&io___417);
    if (erro_ .ierro != 0) {
	goto L100018;
    }
    erro_ .ierro = do_lio(&c__9, &c__1, ch1, 160L);
    if (erro_ .ierro != 0) {
	goto L100018;
    }
    erro_ .ierro = e_wsle();
L100018:
    if (erro_ .ierro != 0) {
	error_(&c__59);
    }
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    if (iclr == 1) {
	s_rsle(&io___418);
	do_lio(&c__3, &c__1, (char *)& anf_ .itra, (ftnlen)sizeof(integer));
	do_lio(&c__5, &c__1, (char *)& anf_ .chi0, (ftnlen)sizeof(doublereal));
	do_lio(&c__5, &c__1, (char *)& anf_ .chid, (ftnlen)sizeof(doublereal));
	do_lio(&c__5, &c__1, (char *)& tra1_ .rat, (ftnlen)sizeof(doublereal));
	do_lio(&c__3, &c__1, (char *)& tra1_ .iver, (ftnlen)sizeof(integer));
	e_rsle();
	if (anf_ .itra > 2) {
	    error_(&c__40);
	}
    }
    if (iclr == 2) {
	s_rsle(&io___419);
	do_lio(&c__5, &c__1, (char *)& anf_ .exz[0], (ftnlen)sizeof(doublereal)
		);
	e_rsle();
    }
    if (iclr == 3) {
	s_rsle(&io___420);
	do_lio(&c__5, &c__1, (char *)& anf_ .exz[2], (ftnlen)sizeof(doublereal)
		);
	e_rsle();
    }
    if (iclr == 4) {
	s_rsle(&io___421);
	do_lio(&c__5, &c__1, (char *)& anf_ .exz[4], (ftnlen)sizeof(doublereal)
		);
	e_rsle();
    }
    if (iclr == 5) {
	s_rsle(&io___422);
	do_lio(&c__5, &c__1, (char *)& anf_ .exz[6], (ftnlen)sizeof(doublereal)
		);
	e_rsle();
    }
    if (iclr == 6) {
	s_rsle(&io___423);
	do_lio(&c__5, &c__1, (char *)& anf_ .exz[8], (ftnlen)sizeof(doublereal)
		);
	e_rsle();
    }
    if (iclr == 7) {
	s_rsle(&io___424);
	do_lio(&c__5, &c__1, (char *)& anf_ .exz[10], (ftnlen)sizeof(
		doublereal));
	e_rsle();
    }
    if (iclr == 8) {
	s_rsle(&io___425);
	do_lio(&c__5, &c__1, (char *)& anf_ .exz[1], (ftnlen)sizeof(doublereal)
		);
	e_rsle();
    }
    if (iclr == 9) {
	s_rsle(&io___426);
	do_lio(&c__5, &c__1, (char *)& anf_ .exz[3], (ftnlen)sizeof(doublereal)
		);
	e_rsle();
    }
    if (iclr == 10) {
	s_rsle(&io___427);
	do_lio(&c__5, &c__1, (char *)& anf_ .exz[5], (ftnlen)sizeof(doublereal)
		);
	e_rsle();
    }
    if (iclr == 11) {
	s_rsle(&io___428);
	do_lio(&c__5, &c__1, (char *)& anf_ .exz[7], (ftnlen)sizeof(doublereal)
		);
	e_rsle();
    }
    if (iclr == 12) {
	s_rsle(&io___429);
	do_lio(&c__5, &c__1, (char *)& anf_ .exz[9], (ftnlen)sizeof(doublereal)
		);
	e_rsle();
    }
    if (iclr == 13) {
	s_rsle(&io___430);
	do_lio(&c__5, &c__1, (char *)& anf_ .exz[11], (ftnlen)sizeof(
		doublereal));
	e_rsle();
    }
    if (iclr == 14) {
	s_rsle(&io___431);
	do_lio(&c__5, &c__1, (char *)& syn_ .e0, (ftnlen)sizeof(doublereal));
	e_rsle();
    }
    if (iclr == 15) {
	s_rsle(&io___432);
	do_lio(&c__5, &c__1, (char *)& syn_ .ej[0], (ftnlen)sizeof(doublereal))
		;
	e_rsle();
    }
    if (iclr == 16) {
	s_rsle(&io___433);
	do_lio(&c__5, &c__1, (char *)& syn_ .ej[1], (ftnlen)sizeof(doublereal))
		;
	e_rsle();
    }
    if (iclr != 16) {
	goto L500;
    }
    anf_ .dp1 = anf_ .exz[10];
    iclr = 0;
    if (tra1_ .iver != 0 && tra1_ .iver != 1) {
	tra1_ .iver = 0;
    }
    nbidu = 1;
    goto L110;
 

 
 

L510:
    erro_ .ierro = s_rsfe(&io___434);
    if (erro_ .ierro != 0) {
	goto L100019;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100019;
    }
    erro_ .ierro = e_rsfe();
L100019:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch != '/') {
	++iclr;
    } else {
	goto L510;
    }
 
    i__2[0] = 80, a__1[0] = ch;
    i__2[1] = 3, a__1[1] = " / ";
    s_cat(ch1, a__1, i__2, &c__2, 83L);
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    erro_ .ierro = s_wsle(&io___435);
    if (erro_ .ierro != 0) {
	goto L100020;
    }
    erro_ .ierro = do_lio(&c__9, &c__1, ch1, 160L);
    if (erro_ .ierro != 0) {
	goto L100020;
    }
    erro_ .ierro = e_wsle();
L100020:
    if (erro_ .ierro != 0) {
	error_(&c__59);
    }
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    if (iclr == 1) {
	s_rsle(&io___436);
	do_lio(&c__3, &c__1, (char *)& tra1_ .numl, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& tra1_ .numlr, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& tra1_ .napx, (ftnlen)sizeof(integer));
	do_lio(&c__5, &c__1, (char *)& (tra_._1) .amp[0], (ftnlen)sizeof(doublereal)
		);
	do_lio(&c__5, &c__1, (char *)& qmodi_ .amp0, (ftnlen)sizeof(doublereal)
		);
	do_lio(&c__3, &c__1, (char *)& tra1_ .ird, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& tra1_ .imc, (ftnlen)sizeof(integer));
	e_rsle();
    }
    if (iclr == 2) {
	s_rsle(&io___437);
	do_lio(&c__3, &c__1, (char *)& syos_ .idz[0], (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& syos_ .idz[1], (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& tra1_ .idfor, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& tra1_ .irew, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& tra1_ .iclo6, (ftnlen)sizeof(integer));
	e_rsle();
    }
    if (iclr == 3) {
	s_rsle(&io___438);
	do_lio(&c__3, &c__1, (char *)& tra1_ .nde[0], (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& tra1_ .nde[1], (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& tra1_ .nwr[0], (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& tra1_ .nwr[1], (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& tra1_ .nwr[2], (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& tra1_ .nwr[3], (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& tra1_ .ntwin, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& tra1_ .ibidu, (ftnlen)sizeof(integer));
	e_rsle();
    }
    if (tra1_ .iclo6 == 5 || tra1_ .iclo6 == 6) {
	tra1_ .iclo6 += -4;
	tra1_ .iclo6r = 1;
    }
    if (tra1_ .iclo6 == 2 && tra1_ .idfor == 0) {
	tra1_ .idfor = 1;
    }
    if (tra1_ .iclo6 == 1 || tra1_ .iclo6 == 2) {
	dial_ .nsix = 0;
    }
    if (iclr != 3) {
	goto L510;
    }
    iclr = 0;
    nbidu = 1;
    goto L110;
 

 
 

L520:
    erro_ .ierro = s_rsfe(&io___439);
    if (erro_ .ierro != 0) {
	goto L100021;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100021;
    }
    erro_ .ierro = e_rsfe();
L100021:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch == '/') {
	goto L520;
    }
    ++ndum;
    if (s_cmp(ch, next, 4L, 16L) == 0) {
	ndum = 0;
	goto L110;
    }
    if (ndum == 1) {
 
	i__2[0] = 80, a__1[0] = ch;
	i__2[1] = 3, a__1[1] = " / ";
	s_cat(ch1, a__1, i__2, &c__2, 83L);
	dial_ .idial = 1;
	tra1_ .numlr = 0;
	tra1_ .napx = 1;
	tra1_ .imc = 1;
	al__1.aerr = 0;
	al__1.aunit = 11;
	f_rew(&al__1);
	erro_ .ierro = s_wsle(&io___440);
	if (erro_ .ierro != 0) {
	    goto L100022;
	}
	erro_ .ierro = do_lio(&c__9, &c__1, ch1, 160L);
	if (erro_ .ierro != 0) {
	    goto L100022;
	}
	erro_ .ierro = e_wsle();
L100022:
	if (erro_ .ierro != 0) {
	    error_(&c__59);
	}
	al__1.aerr = 0;
	al__1.aunit = 11;
	f_rew(&al__1);
	s_rsle(&io___441);
	do_lio(&c__3, &c__1, (char *)& dial_ .nord, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& dial_ .nvar, (ftnlen)sizeof(integer));
	do_lio(&c__5, &c__1, (char *)& dial_ .preda, (ftnlen)sizeof(doublereal)
		);
	do_lio(&c__3, &c__1, (char *)& dial_ .nsix, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& dial_ .ncor, (ftnlen)sizeof(integer));
	e_rsle();
	if (dial_ .nord <= 0 || dial_ .nvar <= 0) {
	    error_(&c__91);
	}
    } else {
	intepr_(&c__3, &c__1, ch, ch1, 80L, 160L);
	s_rsle(&io___442);
	i__1 = dial_ .ncor;
	for (i__ = 1; i__ <= i__1; ++i__) {
	    do_lio(&c__9, &c__1, ilm0 + (i__ - 1 << 4), 16L);
	}
	e_rsle();
    }
    if (tra1_ .iclo6 == 1 || tra1_ .iclo6 == 2) {
	dial_ .nsix = 0;
    }
    if (dial_ .nvar != 6) {
	dial_ .nsix = 0;
	tra1_ .iclo6 = 0;
    }
    if (dial_ .nvar == 5) {
	syn_ .idp = 1;
	syn_ .ition = 1;
	syn_ .hsy[0] = 0.;
    }
    if (ndum == 1) {
	if (dial_ .nsix != 1) {
	    dial_ .nsix = 0;
	}
	if (dial_ .nord > 15) {
	    error_(&c__52);
	}
	dial_ .nvar2 = dial_ .nvar;
	goto L520;
    } else {
	if (dial_ .ncor > 10) {
	    error_(&c__65);
	}
	if (dial_ .ncor > 0) {
	    i__1 = dial_ .ncor;
	    for (j1 = 1; j1 <= i__1; ++j1) {
		i__3 = str_ .il;
		for (j2 = 1; j2 <= i__3; ++j2) {
		    if (s_cmp(ilm0 + (j1 - 1 << 4), linopc_ .bez + (j2 - 1 << 
			    4), 16L, 16L) == 0) {
			if (ell_ .el[j2 - 1] != 0. || ell_ .kz[j2 - 1] > 10) {
			    error_(&c__67);
			}
			dial_ .ipar[j1 - 1] = j2;
			goto L540;
		    }
 
		}
		error_(&c__66);
L540:
		;
	    }
	} else {
	    dial_ .ncor = 0;
	    s_wsle(&io___445);
	    do_lio(&c__9, &c__1, " ", 1L);
	    e_wsle();
	    s_wsle(&io___446);
	    do_lio(&c__9, &c__1, "NO EXTRA PARAMETERS FOR THE MAP SPECIFIED", 
		    41L);
	    e_wsle();
	    s_wsle(&io___447);
	    do_lio(&c__9, &c__1, " ", 1L);
	    e_wsle();
	}
	ndum = 0;
	dial_ .nvar = dial_ .nvar2 + dial_ .ncor;
	goto L110;
    }
 

 
 

L550:
    clo_ .iout = 1;
    goto L110;
 

 
 

L560:
    (chrom_._1) .ichrom = 1;
    for (l = 1; l <= 2; ++l) {
L570:
	erro_ .ierro = s_rsfe(&io___448);
	if (erro_ .ierro != 0) {
	    goto L100023;
	}
	erro_ .ierro = do_fio(&c__1, ch, 80L);
	if (erro_ .ierro != 0) {
	    goto L100023;
	}
	erro_ .ierro = e_rsfe();
L100023:
	if (erro_ .ierro < 0) {
	    goto L1530;
	}
	if (erro_ .ierro > 0) {
	    error_(&c__58);
	}
	if (*(unsigned char *)ch == '/') {
	    goto L570;
	}
	intepr_(&c__1, &c__1, ch, ch1, 80L, 160L);
 
	s_rsle(&io___449);
	do_lio(&c__9, &c__1, iss + (l - 1 << 4), 16L);
	do_lio(&c__5, &c__1, (char *)& (chrom_._1) .cro[l - 1], (ftnlen)sizeof(
		doublereal));
	e_rsle();
    }
    (chrom_._1) .cro[0] = - (chrom_._1) .cro[0];
    (chrom_._1) .cro[1] = - (chrom_._1) .cro[1];
    i__1 = str_ .il;
    for (j = 1; j <= i__1; ++j) {
	if (s_cmp(iss, linopc_ .bez + (j - 1 << 4), 16L, 16L) == 0) {
	    (chrom_._1) .is[0] = j;
	}
 
	if (s_cmp(iss + 16, linopc_ .bez + (j - 1 << 4), 16L, 16L) == 0) {
	    (chrom_._1) .is[1] = j;
	}
    }
    goto L110;
 

 
 

L600:
    qmodi_ .iqmod = 1;
    for (l = 1; l <= 3; ++l) {
L610:
	erro_ .ierro = s_rsfe(&io___450);
	if (erro_ .ierro != 0) {
	    goto L100024;
	}
	erro_ .ierro = do_fio(&c__1, ch, 80L);
	if (erro_ .ierro != 0) {
	    goto L100024;
	}
	erro_ .ierro = e_rsfe();
L100024:
	if (erro_ .ierro < 0) {
	    goto L1530;
	}
	if (erro_ .ierro > 0) {
	    error_(&c__58);
	}
	if (*(unsigned char *)ch == '/') {
	    goto L610;
	}
	if (s_cmp(ch, next, 4L, 16L) == 0) {
	    if ((( qmodi_ .qw0[0] ) >= 0 ? ( qmodi_ .qw0[0] ) : -( qmodi_ .qw0[0] ))  > 1e-17 && (( qmodi_ .qw0[1] ) >= 0 ? ( qmodi_ .qw0[1] ) : -( qmodi_ .qw0[1] ))  > 1e-17) {
		i__1 = str_ .il;
		for (j = 1; j <= i__1; ++j) {
		    if (s_cmp(iqq, linopc_ .bez + (j - 1 << 4), 16L, 16L) == 
			    0) {
			qmodi_ .iq[0] = j;
		    }
 
		    if (s_cmp(iqq + 16, linopc_ .bez + (j - 1 << 4), 16L, 16L)
			     == 0) {
			qmodi_ .iq[1] = j;
		    }
		}
		goto L110;
	    } else {
		s_wsfe(&io___451);
		e_wsfe();
		qmodi_ .iqmod = 0;
		goto L110;
	    }
	}
	intepr_(&c__1, &c__1, ch, ch1, 80L, 160L);
	if (l == 1) {
	    s_rsle(&io___452);
	    do_lio(&c__9, &c__1, iqq, 16L);
	    do_lio(&c__5, &c__1, (char *)& qmodi_ .qw0[0], (ftnlen)sizeof(
		    doublereal));
	    do_lio(&c__3, &c__1, (char *)& qmodi_ .iqmod6, (ftnlen)sizeof(
		    integer));
	    e_rsle();
	}
	if (l == 2) {
	    s_rsle(&io___453);
	    do_lio(&c__9, &c__1, iqq + 16, 16L);
	    do_lio(&c__5, &c__1, (char *)& qmodi_ .qw0[1], (ftnlen)sizeof(
		    doublereal));
	    e_rsle();
	}
 
    }
L640:
    erro_ .ierro = s_rsfe(&io___454);
    if (erro_ .ierro != 0) {
	goto L100025;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100025;
    }
    erro_ .ierro = e_rsfe();
L100025:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch == '/') {
	goto L640;
    }
    intepr_(&c__4, &c__1, ch, ch1, 80L, 160L);
    s_rsle(&io___455);
    do_lio(&c__9, &c__1, iqq + 48, 16L);
    do_lio(&c__9, &c__1, iqq + 64, 16L);
    e_rsle();
    if ((( qmodi_ .qw0[0] ) >= 0 ? ( qmodi_ .qw0[0] ) : -( qmodi_ .qw0[0] ))  > 1e-17 && (( qmodi_ .qw0[1] ) >= 0 ? ( qmodi_ .qw0[1] ) : -( qmodi_ .qw0[1] ))  > 1e-17 && (( 
	    qmodi_ .qw0[2] ) >= 0 ? (  	    qmodi_ .qw0[2] ) : -(  	    qmodi_ .qw0[2] ))  > 1e-17) {
	i__1 = str_ .il;
	for (j = 1; j <= i__1; ++j) {
	    if (s_cmp(iqq, linopc_ .bez + (j - 1 << 4), 16L, 16L) == 0) {
		qmodi_ .iq[0] = j;
	    }
	    if (s_cmp(iqq + 16, linopc_ .bez + (j - 1 << 4), 16L, 16L) == 0) {
		qmodi_ .iq[1] = j;
	    }
	    if (s_cmp(iqq + 32, linopc_ .bez + (j - 1 << 4), 16L, 16L) == 0) {
		qmodi_ .iq[2] = j;
	    }
	    if (s_cmp(iqq + 48, linopc_ .bez + (j - 1 << 4), 16L, 16L) == 0) {
		qmodi_ .kpa[j - 1] = 1;
	    }
 
	    if (s_cmp(iqq + 64, linopc_ .bez + (j - 1 << 4), 16L, 16L) == 0) {
		qmodi_ .kpa[j - 1] = 2;
	    }
	}
	goto L110;
    } else {
	s_wsfe(&io___456);
	e_wsfe();
	qmodi_ .iqmod = 0;
	goto L110;
    }
 

 
 

L660:
    erro_ .ierro = s_rsfe(&io___457);
    if (erro_ .ierro != 0) {
	goto L100026;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100026;
    }
    erro_ .ierro = e_rsfe();
L100026:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch == '/') {
	goto L660;
    }
    if (s_cmp(ch, next, 4L, 16L) == 0) {
	goto L110;
    }
    intepr_(&c__1, &c__1, ch, ch1, 80L, 160L);
    s_rsle(&io___458);
    do_lio(&c__9, &c__1, idat, 16L);
    do_lio(&c__3, &c__1, (char *)& linop_ .nt, (ftnlen)sizeof(integer));
    do_lio(&c__3, &c__1, (char *)& linop_ .ntco, (ftnlen)sizeof(integer));
    do_lio(&c__5, &c__1, (char *)& linop_ .eui, (ftnlen)sizeof(doublereal));
    do_lio(&c__5, &c__1, (char *)& linop_ .euii, (ftnlen)sizeof(doublereal));
    e_rsle();
    linop_ .iprint = 0;
    if (s_cmp(idat, "BLOCK", 16L, 5L) != 0 && s_cmp(idat, "ELEMENT", 16L, 7L) 
	    != 0) {
	error_(&c__45);
    }
    if (s_cmp(idat, "BLOCK", 16L, 5L) == 0) {
	linop_ .iprint = 1;
    }
    linop_ .ilin = 1;
L670:
    for (m = 1; m <= 40; ++m) {
 
	s_copy(ilm0 + (m - 1 << 4), idum, 16L, 16L);
    }
L690:
    erro_ .ierro = s_rsfe(&io___459);
    if (erro_ .ierro != 0) {
	goto L100027;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100027;
    }
    erro_ .ierro = e_rsfe();
L100027:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch == '/') {
	goto L690;
    }
    if (s_cmp(ch, next, 4L, 16L) == 0) {
	goto L110;
    }
    intepr_(&c__2, &c__1, ch, ch1, 80L, 160L);
    s_rsle(&io___460);
    for (m = 1; m <= 40; ++m) {
	do_lio(&c__9, &c__1, ilm0 + (m - 1 << 4), 16L);
    }
    e_rsle();
    for (m = 1; m <= 40; ++m) {
	if (s_cmp(ilm0 + (m - 1 << 4), idum, 16L, 16L) == 0) {
	    goto L700;
	}
	++ linop_ .nlin;
	if (linop_ .nlin > 700) {
	    error_(&c__81);
	}
	s_copy(linopc_ .bezl + (linop_ .nlin - 1 << 4), ilm0 + (m - 1 << 4), 
		16L, 16L);
L700:
	;
    }
    goto L670;
 

 
 

L710:
    erro_ .ierro = s_rsfe(&io___461);
    if (erro_ .ierro != 0) {
	goto L100028;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100028;
    }
    erro_ .ierro = e_rsfe();
L100028:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch != '/') {
	++iclr;
    } else {
	goto L710;
    }
 
    i__2[0] = 80, a__1[0] = ch;
    i__2[1] = 3, a__1[1] = " / ";
    s_cat(ch1, a__1, i__2, &c__2, 83L);
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    erro_ .ierro = s_wsle(&io___462);
    if (erro_ .ierro != 0) {
	goto L100029;
    }
    erro_ .ierro = do_lio(&c__9, &c__1, ch1, 160L);
    if (erro_ .ierro != 0) {
	goto L100029;
    }
    erro_ .ierro = e_wsle();
L100029:
    if (erro_ .ierro != 0) {
	error_(&c__59);
    }
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    if (iclr == 1) {
	s_rsle(&io___463);
	do_lio(&c__5, &c__1, (char *)&harm, (ftnlen)sizeof(doublereal));
	do_lio(&c__5, &c__1, (char *)&alc, (ftnlen)sizeof(doublereal));
	do_lio(&c__5, &c__1, (char *)&u0, (ftnlen)sizeof(doublereal));
	do_lio(&c__5, &c__1, (char *)&phag, (ftnlen)sizeof(doublereal));
	do_lio(&c__5, &c__1, (char *)& syn_ .tlen, (ftnlen)sizeof(doublereal));
	do_lio(&c__5, &c__1, (char *)& syn_ .pma, (ftnlen)sizeof(doublereal));
	do_lio(&c__3, &c__1, (char *)& syn_ .ition, (ftnlen)sizeof(integer));
	do_lio(&c__5, &c__1, (char *)& syn_ .dppoff, (ftnlen)sizeof(doublereal)
		);
	e_rsle();
    }
    if (iclr == 2) {
	s_rsle(&io___465);
	do_lio(&c__5, &c__1, (char *)& cor_ .dpscor, (ftnlen)sizeof(doublereal)
		);
	do_lio(&c__5, &c__1, (char *)& cor_ .sigcor, (ftnlen)sizeof(doublereal)
		);
	e_rsle();
    }
    if (iclr != 2) {
	goto L710;
    }
    iclr = 0;
    if ((d__1 = syn_ .pma - 938.2723128, (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= .1) {
	pmat = 938.2723128;
    }
    if ((d__1 = syn_ .pma - .5109990615, (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= .1) {
	pmat = .5109990615;
    }
    if (pmat != 938.2723128 && pmat != .5109990615) {
	s_wsle(&io___467);
	e_wsle();
	s_wsle(&io___468);
	do_lio(&c__9, &c__1, "Warning: Particle is neither proton nor electron", 48L);
	e_wsle();
	s_wsle(&io___469);
	e_wsle();
    }
    if (syn_ .pma < 1e-17) {
	error_(&c__27);
    }
    syn_ .crad = 1.439965167424243e-15 / syn_ .pma;
    if ((( syn_ .tlen ) >= 0 ? ( syn_ .tlen ) : -( syn_ .tlen ))  <= 1e-17) {
	error_(&c__25);
    }
    if (ncy2 == 0) {
	syn_ .ncy = icy * str_ .mper;
	syn_ .idp = 1;
	if (syn_ .ncy != 0) {
	    goto L720;
	}
	syn_ .idp = 0;
	s_wsfe(&io___470);
	e_wsfe();
	s_wsfe(&io___471);
	e_wsfe();
L720:
	syn_ .phas = phag * kons_ .rad;
	if (syn_ .ncy != 0) {
	    syn_ .hsy[0] = u0 / (doublereal) syn_ .ncy;
	} else {
	    syn_ .hsy[0] = u0;
	}
	if (dial_ .nvar == 5) {
	    syn_ .idp = 1;
	    syn_ .ition = 1;
	    syn_ .hsy[0] = 0.;
	}
	halc = harm * alc;
	halc2 = harm / syn_ .tlen;
	syn_ .hsy[2] = kons_ .pi * 2. * halc2;
	cosy = cos(syn_ .phas);
	qigam = syn_ .pma * syn_ .pma / syn_ .e0 / syn_ .e0;
	qbet = 1. - qigam;
	halc3 = -(qigam - alc) * syn_ .ition * harm * u0 / syn_ .e0 * cosy / (
		kons_ .pi * 2. * qbet);
	if (halc3 < 0.) {
	    error_(&c__28);
	}
	syn_ .qs = sqrt(halc3);
    } else {
	syn_ .idp = 1;
	syn_ .ncy = 0;
	i__1 = str_ .mper * str_ .mbloz;
	for (i__ = 1; i__ <= i__1; ++i__) {
	    ix = str_ .ic[i__ - 1];
	    if (ix > 300) {
		ix += -300;
		if ((i__3 = ell_ .kz[ix - 1], (( i__3 ) >= 0 ? ( i__3 ) : -( i__3 )) ) == 12) {
		    ++ syn_ .ncy;
		}
	    }
 
	}
	i__1 = str_ .il;
	for (j = 1; j <= i__1; ++j) {
	    if ((i__3 = ell_ .kz[j - 1], (( i__3 ) >= 0 ? ( i__3 ) : -( i__3 )) ) == 12) {
		syn_ .hsyc[j - 1] = kons_ .pi * 2. * ell_ .ek[j - 1] / 
			syn_ .tlen;
		if (dial_ .nvar == 5) {
		    syn_ .ition = 1;
		    ell_ .ed[j - 1] = 0.;
		}
	    }
 
	}
    }
    goto L110;
 

 
 

L740:
    erro_ .ierro = s_rsfe(&io___479);
    if (erro_ .ierro != 0) {
	goto L100030;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100030;
    }
    erro_ .ierro = e_rsfe();
L100030:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch == '/') {
	goto L740;
    }
    intepr_(&c__1, &c__1, ch, ch1, 80L, 160L);
    s_rsle(&io___480);
    do_lio(&c__9, &c__1, imn, 16L);
    do_lio(&c__5, &c__1, (char *)&r0, (ftnlen)sizeof(doublereal));
    do_lio(&c__5, &c__1, (char *)& mult1_ .benki, (ftnlen)sizeof(doublereal));
    e_rsle();
    i__ = 1;
    r0a = 1.;
    ++im;
    mult1_ .benkc[im - 1] = mult1_ .benki;
    mult1_ .r00[im - 1] = r0;
    i__1 = str_ .il;
    for (j = 1; j <= i__1; ++j) {
	if (s_cmp(imn, linopc_ .bez + (j - 1 << 4), 16L, 16L) == 0) {
	    mult1_ .irm[j - 1] = im;
	    goto L760;
	}
 
    }
L760:
    s_wsfe(&io___484);
    e_wsfe();
    s_wsfe(&io___485);
    do_fio(&c__1, imn, 16L);
    do_fio(&c__1, (char *)&r0, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)& mult1_ .benki, (ftnlen)sizeof(doublereal));
    e_wsfe();
L770:
    bk0d = 0.;
    bkad = 0.;
    ak0d = 0.;
    akad = 0.;
L780:
    erro_ .ierro = s_rsfe(&io___490);
    if (erro_ .ierro != 0) {
	goto L100031;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100031;
    }
    erro_ .ierro = e_rsfe();
L100031:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch == '/') {
	goto L780;
    }
    if (s_cmp(ch, next, 4L, 16L) == 0) {
	goto L110;
    }
 
    i__2[0] = 80, a__1[0] = ch;
    i__2[1] = 3, a__1[1] = " / ";
    s_cat(ch1, a__1, i__2, &c__2, 83L);
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    erro_ .ierro = s_wsle(&io___491);
    if (erro_ .ierro != 0) {
	goto L100032;
    }
    erro_ .ierro = do_lio(&c__9, &c__1, ch1, 160L);
    if (erro_ .ierro != 0) {
	goto L100032;
    }
    erro_ .ierro = e_wsle();
L100032:
    if (erro_ .ierro != 0) {
	error_(&c__59);
    }
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    s_rsle(&io___492);
    do_lio(&c__5, &c__1, (char *)&bk0d, (ftnlen)sizeof(doublereal));
    do_lio(&c__5, &c__1, (char *)&bkad, (ftnlen)sizeof(doublereal));
    do_lio(&c__5, &c__1, (char *)&ak0d, (ftnlen)sizeof(doublereal));
    do_lio(&c__5, &c__1, (char *)&akad, (ftnlen)sizeof(doublereal));
    e_rsle();
    if ((( bk0d ) >= 0 ? ( bk0d ) : -( bk0d ))  > 1e-17 || (( bkad ) >= 0 ? ( bkad ) : -( bkad ))  > 1e-17 || (( ak0d ) >= 0 ? ( ak0d ) : -( ak0d ))  > 1e-17 || (( 
	    akad ) >= 0 ? (  	    akad ) : -(  	    akad ))  > 1e-17) {
	mult1_ .nmu[j - 1] = i__;
    }
    s_wsfe(&io___493);
    do_fio(&c__1, (char *)&i__, (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)&bk0d, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)&bkad, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)&ak0d, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)&akad, (ftnlen)sizeof(doublereal));
    e_wsfe();
    multi_ .bk0[im + i__ * 700 - 701] = mult1_ .benki * bk0d / r0a;
    multi_ .ak0[im + i__ * 700 - 701] = mult1_ .benki * ak0d / r0a;
    multi_ .bka[im + i__ * 700 - 701] = mult1_ .benki * bkad / r0a;
    multi_ .aka[im + i__ * 700 - 701] = mult1_ .benki * akad / r0a;
    ++i__;
    r0a *= r0;
    if (i__ <= 12) {
	goto L770;
    }
    s_wsfe(&io___494);
    e_wsfe();
    goto L770;
 

 
 

L790:
    erro_ .ierro = s_rsfe(&io___495);
    if (erro_ .ierro != 0) {
	goto L100033;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100033;
    }
    erro_ .ierro = e_rsfe();
L100033:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch == '/') {
	goto L790;
    }
 
    i__2[0] = 80, a__1[0] = ch;
    i__2[1] = 3, a__1[1] = " / ";
    s_cat(ch1, a__1, i__2, &c__2, 83L);
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    erro_ .ierro = s_wsle(&io___496);
    if (erro_ .ierro != 0) {
	goto L100034;
    }
    erro_ .ierro = do_lio(&c__9, &c__1, ch1, 160L);
    if (erro_ .ierro != 0) {
	goto L100034;
    }
    erro_ .ierro = e_wsle();
L100034:
    if (erro_ .ierro != 0) {
	error_(&c__59);
    }
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    s_rsle(&io___497);
    do_lio(&c__3, &c__1, (char *)& rand0_ .izu0, (ftnlen)sizeof(integer));
    do_lio(&c__3, &c__1, (char *)& rand0_ .mmac, (ftnlen)sizeof(integer));
    do_lio(&c__3, &c__1, (char *)&mout, (ftnlen)sizeof(integer));
    do_lio(&c__3, &c__1, (char *)& rand0_ .mcut, (ftnlen)sizeof(integer));
    e_rsle();
    rand0_ .mcut = (( rand0_ .mcut ) >= 0 ? ( rand0_ .mcut ) : -( rand0_ .mcut )) ;
    if (rand0_ .mmac > 1) {
	error_(&c__55);
    }
    recuin_(& rand0_ .izu0, &irecuin);
    ranecu_(rand0_ .zfz, &c_b1102, & rand0_ .mcut);
    rsum = 0.;
    for (i__ = 1; i__ <= 300000; ++i__) {
 
	rsum += rand0_ .zfz[i__ - 1];
    }
    rmean = rsum / 300000;
    rsqsum = 0.;
    for (i__ = 1; i__ <= 300000; ++i__) {
 
	rsqsum += (rand0_ .zfz[i__ - 1] - rmean) * (rand0_ .zfz[i__ - 1] - 
		rmean);
    }
    rdev = sqrt(rsqsum / 300000);
    s_wsfe(&io___502);
    do_fio(&c__1, (char *)& rand0_ .izu0, (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)&c_b1102, (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)&rmean, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)&rdev, (ftnlen)sizeof(doublereal));
    e_wsfe();
    if (rand0_ .mcut == 0) {
	s_wsfe(&io___503);
	e_wsfe();
    }
    if (rand0_ .mcut > 0) {
	s_wsfe(&io___504);
	do_fio(&c__1, (char *)& rand0_ .mcut, (ftnlen)sizeof(integer));
	e_wsfe();
    }
    s_wsfe(&io___505);
    e_wsfe();
    if (mout >= 8) {
	mout4 = 1;
    }
    if (mout == 7 || mout == 15) {
	mout1 = 1;
	rand1_ .mout2 = 1;
	mout3 = 1;
    } else if (mout == 6 || mout == 14) {
	rand1_ .mout2 = 1;
	mout3 = 1;
    } else if (mout == 5 || mout == 13) {
	mout1 = 1;
	mout3 = 1;
    } else if (mout == 4 || mout == 12) {
	mout3 = 1;
    } else if (mout == 3 || mout == 11) {
	mout1 = 1;
	rand1_ .mout2 = 1;
    } else if (mout == 2 || mout == 10) {
	rand1_ .mout2 = 1;
    } else if (mout == 1 || mout == 9) {
	mout1 = 1;
    }
    if (mout1 == 1) {
	s_wsle(&io___506);
	e_wsle();
	s_wsle(&io___507);
	do_lio(&c__9, &c__1, "          Multipole errors read in ", 35L);
	do_lio(&c__9, &c__1, "from external file", 18L);
	e_wsle();
	s_wsle(&io___508);
	e_wsle();
	iexread = 0;
	ifiend16 = 0;
	iexnum = 0;
	i__1 = s_rsfe(&io___512);
	if (i__1 != 0) {
	    goto L861;
	}
	i__1 = e_rsfe();
	if (i__1 != 0) {
	    goto L861;
	}
	al__1.aerr = 0;
	al__1.aunit = 16;
	f_rew(&al__1);
	i__1 = str_ .mper * str_ .mbloz;
	for (i__ = 1; i__ <= i__1; ++i__) {
	    ix = str_ .ic[i__ - 1];
	    if (ix > 300) {
		ix += -300;
		if (iexread == 0) {
		    s_copy(ilm0, " ", 16L, 1L);
 

		    if (ifiend16 == 0) {
			erro_ .ierro = s_rsfe(&io___513);
			if (erro_ .ierro != 0) {
			    goto L100035;
			}
			erro_ .ierro = do_fio(&c__1, ch, 80L);
			if (erro_ .ierro != 0) {
			    goto L100035;
			}
			erro_ .ierro = e_rsfe();
L100035:
			if (erro_ .ierro < 0) {
			    goto L820;
			}
		    } else {
			goto L820;
		    }
		    intepr_(&c__3, &c__1, ch, ch1, 80L, 160L);
		    s_rsle(&io___514);
		    do_lio(&c__9, &c__1, ilm0, 16L);
		    e_rsle();
		    ++iexnum;
		    s_copy(bezext + (iexnum - 1 << 4), ilm0, 16L, 16L);
		    erro_ .ierro = s_rsle(&io___516);
		    if (erro_ .ierro != 0) {
			goto L100036;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[0], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100036;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[1], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100036;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[2], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100036;
		    }
		    erro_ .ierro = e_rsle();
L100036:
		    if (erro_ .ierro < 0) {
			goto L870;
		    }
		    erro_ .ierro = s_rsle(&io___517);
		    if (erro_ .ierro != 0) {
			goto L100037;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[3], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100037;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[4], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100037;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[5], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100037;
		    }
		    erro_ .ierro = e_rsle();
L100037:
		    if (erro_ .ierro < 0) {
			goto L870;
		    }
		    erro_ .ierro = s_rsle(&io___518);
		    if (erro_ .ierro != 0) {
			goto L100038;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[6], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100038;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[7], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100038;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[8], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100038;
		    }
		    erro_ .ierro = e_rsle();
L100038:
		    if (erro_ .ierro < 0) {
			goto L870;
		    }
		    erro_ .ierro = s_rsle(&io___519);
		    if (erro_ .ierro != 0) {
			goto L100039;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[9], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100039;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[10], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100039;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[11], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100039;
		    }
		    erro_ .ierro = e_rsle();
L100039:
		    if (erro_ .ierro < 0) {
			goto L870;
		    }
		    erro_ .ierro = s_rsle(&io___520);
		    if (erro_ .ierro != 0) {
			goto L100040;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[12], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100040;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[13], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100040;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[14], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100040;
		    }
		    erro_ .ierro = e_rsle();
L100040:
		    if (erro_ .ierro < 0) {
			goto L870;
		    }
		    erro_ .ierro = s_rsle(&io___521);
		    if (erro_ .ierro != 0) {
			goto L100041;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[15], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100041;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[16], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100041;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[17], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100041;
		    }
		    erro_ .ierro = e_rsle();
L100041:
		    if (erro_ .ierro < 0) {
			goto L870;
		    }
		    erro_ .ierro = s_rsle(&io___522);
		    if (erro_ .ierro != 0) {
			goto L100042;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[18], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100042;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[19], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100042;
		    }
		    erro_ .ierro = e_rsle();
L100042:
		    if (erro_ .ierro < 0) {
			goto L870;
		    }
		    erro_ .ierro = s_rsle(&io___523);
		    if (erro_ .ierro != 0) {
			goto L100043;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[20], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100043;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[21], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100043;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[22], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100043;
		    }
		    erro_ .ierro = e_rsle();
L100043:
		    if (erro_ .ierro < 0) {
			goto L870;
		    }
		    erro_ .ierro = s_rsle(&io___524);
		    if (erro_ .ierro != 0) {
			goto L100044;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[23], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100044;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[24], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100044;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[25], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100044;
		    }
		    erro_ .ierro = e_rsle();
L100044:
		    if (erro_ .ierro < 0) {
			goto L870;
		    }
		    erro_ .ierro = s_rsle(&io___525);
		    if (erro_ .ierro != 0) {
			goto L100045;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[26], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100045;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[27], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100045;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[28], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100045;
		    }
		    erro_ .ierro = e_rsle();
L100045:
		    if (erro_ .ierro < 0) {
			goto L870;
		    }
		    erro_ .ierro = s_rsle(&io___526);
		    if (erro_ .ierro != 0) {
			goto L100046;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[29], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100046;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[30], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100046;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[31], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100046;
		    }
		    erro_ .ierro = e_rsle();
L100046:
		    if (erro_ .ierro < 0) {
			goto L870;
		    }
		    erro_ .ierro = s_rsle(&io___527);
		    if (erro_ .ierro != 0) {
			goto L100047;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[32], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100047;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[33], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100047;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[34], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100047;
		    }
		    erro_ .ierro = e_rsle();
L100047:
		    if (erro_ .ierro < 0) {
			goto L870;
		    }
		    erro_ .ierro = s_rsle(&io___528);
		    if (erro_ .ierro != 0) {
			goto L100048;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[35], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100048;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[36], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100048;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[37], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100048;
		    }
		    erro_ .ierro = e_rsle();
L100048:
		    if (erro_ .ierro < 0) {
			goto L870;
		    }
		    erro_ .ierro = s_rsle(&io___529);
		    if (erro_ .ierro != 0) {
			goto L100049;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[38], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100049;
		    }
		    erro_ .ierro = do_lio(&c__5, &c__1, (char *)&extaux[39], (
			    ftnlen)sizeof(doublereal));
		    if (erro_ .ierro != 0) {
			goto L100049;
		    }
		    erro_ .ierro = e_rsle();
L100049:
		    if (erro_ .ierro < 0) {
			goto L870;
		    }
		    if (erro_ .ierro > 0) {
			error_(&c__80);
		    }
		    iexread = 1;
		    goto L840;
L820:
		    ifiend16 = 1;
		    if (iexnum == 0) {
			error_(&c__80);
		    }
		    i__3 = iexnum;
		    for (j = 1; j <= i__3; ++j) {
			if (s_cmp(linopc_ .bez + (ix - 1 << 4), bezext + (j - 
				1 << 4), 16L, 16L) == 0) {
			    error_(&c__80);
			}
 
		    }
L840:
		    ;
		}
		if (s_cmp(ilm0, linopc_ .bez + (ix - 1 << 4), 16L, 16L) == 0) 
			{
		    rand1_ .icext[i__ - 1] = ix;
		    for (k = 1; k <= 40; ++k) {
			rand1_ .exterr[i__ + k * 20000 - 20001] = extaux[k - 
				1];
 
		    }
		    iexread = 0;
		    goto L860;
		}
	    }
L860:
	    ;
	}
L861:
	s_wsle(&io___530);
	do_lio(&c__9, &c__1, "        From file fort.16 :", 27L);
	do_lio(&c__3, &c__1, (char *)&iexnum, (ftnlen)sizeof(integer));
	do_lio(&c__9, &c__1, " values read in.", 16L);
	e_wsle();
	s_wsle(&io___531);
	e_wsle();
    }
    if (mout3 == 1) {
	s_wsle(&io___532);
	e_wsle();
	s_wsle(&io___533);
	do_lio(&c__9, &c__1, "          Alignment errors read in ", 35L);
	do_lio(&c__9, &c__1, "from external file", 18L);
	e_wsle();
	s_wsle(&io___534);
	e_wsle();
	iexread = 0;
	ifiend8 = 0;
	iexnum = 0;
	i__1 = s_rsfe(&io___536);
	if (i__1 != 0) {
	    goto L1581;
	}
	i__1 = e_rsfe();
	if (i__1 != 0) {
	    goto L1581;
	}
	al__1.aerr = 0;
	al__1.aunit = 8;
	f_rew(&al__1);
	i__1 = str_ .mper * str_ .mbloz;
	for (i__ = 1; i__ <= i__1; ++i__) {
	    ix = str_ .ic[i__ - 1];
	    if (ix > 300) {
		ix += -300;
		if (iexread == 0) {
		    s_copy(ilm0, " ", 16L, 1L);
 

		    if (ifiend8 == 0) {
			erro_ .ierro = s_rsfe(&io___537);
			if (erro_ .ierro != 0) {
			    goto L100050;
			}
			erro_ .ierro = do_fio(&c__1, ch, 80L);
			if (erro_ .ierro != 0) {
			    goto L100050;
			}
			erro_ .ierro = e_rsfe();
L100050:
			if (erro_ .ierro < 0) {
			    goto L1550;
			}
			if (erro_ .ierro > 0) {
			    error_(&c__86);
			}
		    } else {
			goto L1550;
		    }
		    intepr_(&c__1, &c__1, ch, ch1, 80L, 160L);
		    s_rsle(&io___538);
		    do_lio(&c__9, &c__1, ilm0, 16L);
		    do_lio(&c__5, &c__1, (char *)&alignx, (ftnlen)sizeof(
			    doublereal));
		    do_lio(&c__5, &c__1, (char *)&alignz, (ftnlen)sizeof(
			    doublereal));
		    do_lio(&c__5, &c__1, (char *)&tilt, (ftnlen)sizeof(
			    doublereal));
		    e_rsle();
		    ++iexnum;
		    s_copy(bezext + (iexnum - 1 << 4), ilm0, 16L, 16L);
		    iexread = 1;
		    goto L1570;
L1550:
		    ifiend8 = 1;
		    if (iexnum == 0) {
			error_(&c__86);
		    }
		    i__3 = iexnum;
		    for (j = 1; j <= i__3; ++j) {
			if (s_cmp(linopc_ .bez + (ix - 1 << 4), bezext + (j - 
				1 << 4), 16L, 16L) == 0) {
			    error_(&c__86);
			}
 
		    }
L1570:
		    ;
		}
		if (s_cmp(ilm0, linopc_ .bez + (ix - 1 << 4), 16L, 16L) == 0) 
			{
		    rand1_ .icextal[i__ - 1] = ix;
		    rand1_ .extalign[i__ - 1] = alignx;
		    rand1_ .extalign[i__ + 19999] = alignz;
		    rand1_ .extalign[i__ + 39999] = tilt;
		    iexread = 0;
		    goto L1580;
		}
	    }
L1580:
	    ;
	}
L1581:
	s_wsle(&io___542);
	do_lio(&c__9, &c__1, "        From file fort.8 :", 26L);
	do_lio(&c__3, &c__1, (char *)&iexnum, (ftnlen)sizeof(integer));
	do_lio(&c__9, &c__1, " values read in.", 16L);
	e_wsle();
	s_wsle(&io___543);
	e_wsle();
    }
    izu = 0;
    iexnum = 0;
    if (mout4 == 1) {
	i__1 = s_rsfe(&io___545);
	if (i__1 != 0) {
	    goto L1591;
	}
	i__1 = e_rsfe();
	if (i__1 != 0) {
	    goto L1591;
	}
	al__1.aerr = 0;
	al__1.aunit = 30;
	f_rew(&al__1);
	i__1 = str_ .mper * str_ .mbloz;
	for (i__ = 1; i__ <= i__1; ++i__) {
	    ix = str_ .ic[i__ - 1];
	    if (ix > 300) {
		ix += -300;
		kpz = ell_ .kp[ix - 1];
		kzz = ell_ .kz[ix - 1];
		if (kpz == 6 || kzz == 0) {
		    goto L1590;
		}
		izu += 3;
		erro_ .ierro = s_rsfe(&io___548);
		if (erro_ .ierro != 0) {
		    goto L100051;
		}
		erro_ .ierro = do_fio(&c__1, ch, 80L);
		if (erro_ .ierro != 0) {
		    goto L100051;
		}
		erro_ .ierro = e_rsfe();
L100051:
		if (erro_ .ierro < 0) {
		    goto L1591;
		}
		if (erro_ .ierro > 0) {
		    error_(&c__87);
		}
		intepr_(&c__1, &c__1, ch, ch1, 80L, 160L);
		s_rsle(&io___549);
		do_lio(&c__9, &c__1, ilm0, 16L);
		do_lio(&c__5, &c__1, (char *)& rand0_ .zfz[izu - 3], (ftnlen)
			sizeof(doublereal));
		e_rsle();
		++iexnum;
		if (ell_ .kz[ix - 1] == 11) {
		    izu += 22;
		}
	    }
L1590:
	    ;
	}
	if (iexnum > 0) {
	    s_wsle(&io___550);
	    e_wsle();
	    s_wsle(&io___551);
	    do_lio(&c__9, &c__1, "          Single (random) kick errors read in ", 46L);
	    do_lio(&c__9, &c__1, "from external file", 18L);
	    e_wsle();
	    s_wsle(&io___552);
	    e_wsle();
	    s_wsle(&io___553);
	    do_lio(&c__9, &c__1, "        From file fort.30 :", 27L);
	    do_lio(&c__3, &c__1, (char *)&iexnum, (ftnlen)sizeof(integer));
	    do_lio(&c__9, &c__1, " values read in.", 16L);
	    e_wsle();
	    s_wsle(&io___554);
	    e_wsle();
	}
	iexread = 0;
	ifiend8 = 0;
	iexnum = 0;
	al__1.aerr = 0;
	al__1.aunit = 30;
	f_rew(&al__1);
	i__1 = str_ .mper * str_ .mbloz;
	for (i__ = 1; i__ <= i__1; ++i__) {
	    ix = str_ .ic[i__ - 1];
	    if (ix > 300) {
		ix += -300;
		if (iexread == 0) {
L1595:
		    s_copy(ilm0, " ", 16L, 1L);
 

		    if (ifiend8 == 0) {
			erro_ .ierro = s_rsfe(&io___555);
			if (erro_ .ierro != 0) {
			    goto L100052;
			}
			erro_ .ierro = do_fio(&c__1, ch, 80L);
			if (erro_ .ierro != 0) {
			    goto L100052;
			}
			erro_ .ierro = e_rsfe();
L100052:
			if (erro_ .ierro < 0) {
			    goto L1594;
			}
			if (erro_ .ierro > 0) {
			    error_(&c__87);
			}
		    } else {
			goto L1594;
		    }
		    intepr_(&c__1, &c__1, ch, ch1, 80L, 160L);
		    s_rsle(&io___556);
		    do_lio(&c__9, &c__1, ilm0, 16L);
		    do_lio(&c__5, &c__1, (char *)&dummy, (ftnlen)sizeof(
			    doublereal));
		    do_lio(&c__5, &c__1, (char *)&alignx, (ftnlen)sizeof(
			    doublereal));
		    do_lio(&c__5, &c__1, (char *)&alignz, (ftnlen)sizeof(
			    doublereal));
		    do_lio(&c__5, &c__1, (char *)&tilt, (ftnlen)sizeof(
			    doublereal));
		    e_rsle();
		    if ((( alignx ) >= 0 ? ( alignx ) : -( alignx ))  + (( alignz ) >= 0 ? ( alignz ) : -( alignz ))  + (( tilt ) >= 0 ? ( tilt ) : -( tilt ))  <= 1e-17) {
			goto L1595;
		    }
		    ++iexnum;
		    s_copy(bezext + (iexnum - 1 << 4), ilm0, 16L, 16L);
		    iexread = 1;
		    goto L1596;
L1594:
		    ifiend8 = 1;
		    i__3 = iexnum;
		    for (j = 1; j <= i__3; ++j) {
			if (s_cmp(linopc_ .bez + (ix - 1 << 4), bezext + (j - 
				1 << 4), 16L, 16L) == 0) {
			    error_(&c__87);
			}
 
		    }
L1596:
		    ;
		}
		if (s_cmp(ilm0, linopc_ .bez + (ix - 1 << 4), 16L, 16L) == 0) 
			{
		    rand1_ .icextal[i__ - 1] = ix;
		    rand1_ .extalign[i__ - 1] = alignx;
		    rand1_ .extalign[i__ + 19999] = alignz;
		    rand1_ .extalign[i__ + 39999] = tilt;
		    iexread = 0;
		    goto L1593;
		}
	    }
L1593:
	    ;
	}
L1591:
	;
    }
    goto L110;
L870:
    error_(&c__80);
 

 
 

L880:
    s_wsfe(&io___558);
    e_wsfe();
    s_wsfe(&io___559);
    e_wsfe();
    for (i__ = 1; i__ <= 3; ++i__) {
	for (j = 1; j <= 700; ++j) {
 
	    s_copy(rand0c_ .bezr + (i__ + j * 3 - 4 << 4), idum, 16L, 16L);
	}
    }
L900:
    ++ rand0_ .iorg;
L910:
    erro_ .ierro = s_rsfe(&io___560);
    if (erro_ .ierro != 0) {
	goto L100053;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100053;
    }
    erro_ .ierro = e_rsfe();
L100053:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch == '/') {
	goto L910;
    }
    intepr_(&c__3, &c__1, ch, ch1, 80L, 160L);
    s_rsle(&io___561);
    do_lio(&c__9, &c__1, idat, 16L);
    do_lio(&c__9, &c__1, rand0c_ .bezr + (rand0_ .iorg * 3 - 2 << 4), 16L);
    do_lio(&c__9, &c__1, rand0c_ .bezr + (rand0_ .iorg * 3 - 1 << 4), 16L);
    e_rsle();
    if (s_cmp(idat, next, 16L, 16L) != 0) {
	if (s_cmp(idat, mult, 16L, 16L) != 0 && s_cmp(idat, idum, 16L, 16L) !=
		 0 && s_cmp(rand0c_ .bezr + (rand0_ .iorg * 3 - 2 << 4), idum,
		 16L, 16L) == 0) {
	    s_wsfe(&io___562);
	    do_fio(&c__1, idat, 16L);
	    e_wsfe();
	}
	if (s_cmp(idat, mult, 16L, 16L) != 0 && s_cmp(idat, idum, 16L, 16L) !=
		 0 && s_cmp(rand0c_ .bezr + (rand0_ .iorg * 3 - 2 << 4), idum,
		 16L, 16L) != 0) {
	    s_wsfe(&io___563);
	    do_fio(&c__1, idat, 16L);
	    do_fio(&c__1, rand0c_ .bezr + (rand0_ .iorg * 3 - 2 << 4), 16L);
	    e_wsfe();
	}
	if (s_cmp(idat, mult, 16L, 16L) != 0) {
	    s_copy(rand0c_ .bezr + (rand0_ .iorg * 3 - 3 << 4), idat, 16L, 
		    16L);
	}
	if (s_cmp(idat, mult, 16L, 16L) == 0 && s_cmp(rand0c_ .bezr + (
		rand0_ .iorg * 3 - 2 << 4), idum, 16L, 16L) != 0 && s_cmp(
		rand0c_ .bezr + (rand0_ .iorg * 3 - 1 << 4), idum, 16L, 16L) 
		!= 0) {
	    s_wsfe(&io___564);
	    do_fio(&c__1, rand0c_ .bezr + (rand0_ .iorg * 3 - 2 << 4), 16L);
	    do_fio(&c__1, rand0c_ .bezr + (rand0_ .iorg * 3 - 1 << 4), 16L);
	    e_wsfe();
	    ++im;
	    j0 = 0;
	    j1 = 0;
	    i__1 = str_ .il;
	    for (i__ = 1; i__ <= i__1; ++i__) {
		if (s_cmp(linopc_ .bez + (i__ - 1 << 4), rand0c_ .bezr + (
			rand0_ .iorg * 3 - 2 << 4), 16L, 16L) == 0) {
		    j1 = i__;
		}
 
		if (s_cmp(linopc_ .bez + (i__ - 1 << 4), rand0c_ .bezr + (
			rand0_ .iorg * 3 - 1 << 4), 16L, 16L) == 0) {
		    j0 = i__;
		}
	    }
	    if (j0 == 0 || j1 == 0 || ell_ .kz[j0 - 1] != 11 || ell_ .kz[j1 - 
		    1] != 11) {
		error_(&c__29);
	    }
	    mult1_ .irm[j0 - 1] = im;
	    mult1_ .benkc[j0 - 1] = mult1_ .benkc[j1 - 1];
	    mult1_ .r00[j0 - 1] = mult1_ .r00[j1 - 1];
	    imo = mult1_ .irm[j1 - 1];
	    mult1_ .nmu[j0 - 1] = mult1_ .nmu[j1 - 1];
	    i__1 = mult1_ .nmu[j0 - 1];
	    for (i1 = 1; i1 <= i__1; ++i1) {
		multi_ .bk0[im + i1 * 700 - 701] = multi_ .bk0[imo + i1 * 700 
			- 701];
		multi_ .bka[im + i1 * 700 - 701] = multi_ .bka[imo + i1 * 700 
			- 701];
		multi_ .ak0[im + i1 * 700 - 701] = multi_ .ak0[imo + i1 * 700 
			- 701];
 
		multi_ .aka[im + i1 * 700 - 701] = multi_ .aka[imo + i1 * 700 
			- 701];
	    }
	}
	goto L900;
    }
    s_wsfe(&io___568);
    e_wsfe();
    goto L110;
 

 
 

L940:
    erro_ .ierro = s_rsfe(&io___569);
    if (erro_ .ierro != 0) {
	goto L100054;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100054;
    }
    erro_ .ierro = e_rsfe();
L100054:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch != '/') {
	++iclr;
    } else {
	goto L940;
    }
    if (s_cmp(ch, next, 4L, 16L) == 0) {
	iclr = 0;
	goto L110;
    }
 
    i__2[0] = 80, a__1[0] = ch;
    i__2[1] = 3, a__1[1] = " / ";
    s_cat(ch1, a__1, i__2, &c__2, 83L);
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    erro_ .ierro = s_wsle(&io___570);
    if (erro_ .ierro != 0) {
	goto L100055;
    }
    erro_ .ierro = do_lio(&c__9, &c__1, ch1, 160L);
    if (erro_ .ierro != 0) {
	goto L100055;
    }
    erro_ .ierro = e_wsle();
L100055:
    if (erro_ .ierro != 0) {
	error_(&c__59);
    }
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    if (iclr == 1) {
	s_rsle(&io___571);
	do_lio(&c__3, &c__1, (char *)& clo_ .itco, (ftnlen)sizeof(integer));
	do_lio(&c__5, &c__1, (char *)& clo_ .dma, (ftnlen)sizeof(doublereal));
	do_lio(&c__5, &c__1, (char *)& clo_ .dmap, (ftnlen)sizeof(doublereal));
	e_rsle();
    }
    if (iclr == 2) {
	s_rsle(&io___572);
	do_lio(&c__3, &c__1, (char *)& clo_ .itqv, (ftnlen)sizeof(integer));
	do_lio(&c__5, &c__1, (char *)& clo_ .dkq, (ftnlen)sizeof(doublereal));
	do_lio(&c__5, &c__1, (char *)& clo_ .dqq, (ftnlen)sizeof(doublereal));
	e_rsle();
    }
    if (iclr == 3) {
	s_rsle(&io___573);
	do_lio(&c__3, &c__1, (char *)& clo_ .itcro, (ftnlen)sizeof(integer));
	do_lio(&c__5, &c__1, (char *)& clo_ .dsm0, (ftnlen)sizeof(doublereal));
	do_lio(&c__5, &c__1, (char *)& clo_ .dech, (ftnlen)sizeof(doublereal));
	e_rsle();
    }
    if (iclr == 4) {
	s_rsle(&io___574);
	do_lio(&c__5, &c__1, (char *)& clo_ .de0, (ftnlen)sizeof(doublereal));
	do_lio(&c__5, &c__1, (char *)& clo_ .ded, (ftnlen)sizeof(doublereal));
	do_lio(&c__5, &c__1, (char *)& clo_ .dsi, (ftnlen)sizeof(doublereal));
	e_rsle();
    }
    if (iclr != 4) {
	goto L940;
    }
    iclr = 0;
    goto L110;
 

 
 

L950:
    s_wsfe(&io___575);
    e_wsfe();
L960:
    erro_ .ierro = s_rsfe(&io___576);
    if (erro_ .ierro != 0) {
	goto L100056;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100056;
    }
    erro_ .ierro = e_rsfe();
L100056:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch == '/') {
	goto L960;
    }
    apxx = 0.;
    apzz = 0.;
    intepr_(&c__8, &c__1, ch, ch1, 80L, 160L);
    s_rsle(&io___579);
    do_lio(&c__9, &c__1, idat, 16L);
    do_lio(&c__9, &c__1, irel, 16L);
    do_lio(&c__5, &c__1, (char *)&apxx, (ftnlen)sizeof(doublereal));
    do_lio(&c__5, &c__1, (char *)&apzz, (ftnlen)sizeof(doublereal));
    e_rsle();
    i__1 = str_ .il;
    for (j = 1; j <= i__1; ++j) {
	if (s_cmp(idat, linopc_ .bez + (j - 1 << 4), 16L, 16L) != 0) {
	    goto L970;
	}
	ell_ .kp[j - 1] = 1;
	if (s_cmp(irel, rect, 16L, 16L) == 0) {
	    ell_ .kp[j - 1] = 2;
	}
	apert_ .apx[j - 1] = apxx;
	apert_ .apz[j - 1] = apzz;
	s_wsfe(&io___581);
	do_fio(&c__1, linopc_ .bez + (j - 1 << 4), 16L);
	do_fio(&c__1, irel, 16L);
	do_fio(&c__1, (char *)&apxx, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&apzz, (ftnlen)sizeof(doublereal));
	e_wsfe();
L970:
	;
    }
    if (s_cmp(idat, next, 16L, 16L) != 0) {
	goto L960;
    }
    goto L110;
 

 
 

L980:
    erro_ .ierro = s_rsfe(&io___582);
    if (erro_ .ierro != 0) {
	goto L100057;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100057;
    }
    erro_ .ierro = e_rsfe();
L100057:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch == '/') {
	goto L980;
    }
 
    i__2[0] = 80, a__1[0] = ch;
    i__2[1] = 3, a__1[1] = " / ";
    s_cat(ch1, a__1, i__2, &c__2, 83L);
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    erro_ .ierro = s_wsle(&io___583);
    if (erro_ .ierro != 0) {
	goto L100058;
    }
    erro_ .ierro = do_lio(&c__9, &c__1, ch1, 160L);
    if (erro_ .ierro != 0) {
	goto L100058;
    }
    erro_ .ierro = e_wsle();
L100058:
    if (erro_ .ierro != 0) {
	error_(&c__59);
    }
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    s_rsle(&io___584);
    do_lio(&c__5, &c__2, (char *)& clos_ .sigma0[0], (ftnlen)sizeof(doublereal)
	    );
    do_lio(&c__3, &c__1, (char *)& clos_ .ncorru, (ftnlen)sizeof(integer));
    do_lio(&c__3, &c__1, (char *)& clos_ .ncorrep, (ftnlen)sizeof(integer));
    e_rsle();
    clos_ .iclo = 1;
L990:
    erro_ .ierro = s_rsfe(&io___585);
    if (erro_ .ierro != 0) {
	goto L100059;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100059;
    }
    erro_ .ierro = e_rsfe();
L100059:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch == '/') {
	goto L990;
    }
    s_copy(iele, idum, 16L, 16L);
    intepr_(&c__4, &c__1, ch, ch1, 80L, 160L);
    s_rsle(&io___587);
    do_lio(&c__9, &c__1, idat, 16L);
    do_lio(&c__9, &c__1, iele, 16L);
    e_rsle();
    if (s_cmp(idat, next, 16L, 16L) == 0) {
	goto L110;
    }
    if (s_cmp(idat, "HMON=", 16L, 5L) != 0 && s_cmp(idat, "HCOR=", 16L, 5L) !=
	     0 && s_cmp(idat, "VMON=", 16L, 5L) != 0 && s_cmp(idat, "VCOR=", 
	    16L, 5L) != 0) {
	error_(&c__44);
    }
    if (s_cmp(idat, "HMON=", 16L, 5L) == 0 || s_cmp(idat, "VMON=", 16L, 5L) ==
	     0) {
	goto L1010;
    }
    i__1 = str_ .il;
    for (j = 1; j <= i__1; ++j) {
	if (s_cmp(iele, linopc_ .bez + (j - 1 << 4), 16L, 16L) != 0) {
	    goto L1000;
	}
	if (s_cmp(idat, "HCOR=", 16L, 5L) == 0) {
	    if (ell_ .kp[j - 1] == -4 || ell_ .kp[j - 1] == 3 || ell_ .kp[j - 
		    1] == -3) {
		error_(&c__83);
	    }
	    if (ell_ .kz[j - 1] != 1 && ell_ .kz[j - 1] != 11) {
		error_(&c__82);
	    }
	    ell_ .kp[j - 1] = 4;
	}
	if (s_cmp(idat, "VCOR=", 16L, 5L) == 0) {
	    if (ell_ .kp[j - 1] == 4 || ell_ .kp[j - 1] == 3 || ell_ .kp[j - 
		    1] == -3) {
		error_(&c__83);
	    }
	    if (ell_ .kz[j - 1] != -1 && ell_ .kz[j - 1] != 11) {
		error_(&c__82);
	    }
	    ell_ .kp[j - 1] = -4;
	}
L1000:
	;
    }
    goto L990;
L1010:
    i__1 = str_ .il;
    for (j = 1; j <= i__1; ++j) {
	if (s_cmp(iele, linopc_ .bez + (j - 1 << 4), 16L, 16L) != 0) {
	    goto L1020;
	}
	if (s_cmp(idat, "HMON=", 16L, 5L) == 0) {
	    if (ell_ .kp[j - 1] == 4 || ell_ .kp[j - 1] == -4 || ell_ .kp[j - 
		    1] == -3) {
		error_(&c__83);
	    }
	    ell_ .kp[j - 1] = 3;
	}
	if (s_cmp(idat, "VMON=", 16L, 5L) == 0) {
	    if (ell_ .kp[j - 1] == 4 || ell_ .kp[j - 1] == -4 || ell_ .kp[j - 
		    1] == 3) {
		error_(&c__83);
	    }
	    ell_ .kp[j - 1] = -3;
	}
L1020:
	;
    }
    goto L990;
 

 
 

L1030:
    ii = 0;
    for (jj = 1; jj <= 100; ++jj) {
	for (ll = 1; ll <= 20; ++ll) {
 
	    s_copy(icel + (jj + ll * 100 - 101 << 4), idum, 16L, 16L);
	}
    }
    s_wsfe(&io___589);
    e_wsfe();
    s_wsfe(&io___590);
    e_wsfe();
L1050:
    ++ii;
    if (ii > 100) {
	goto L1100;
    }
L1060:
    erro_ .ierro = s_rsfe(&io___591);
    if (erro_ .ierro != 0) {
	goto L100060;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100060;
    }
    erro_ .ierro = e_rsfe();
L100060:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch == '/') {
	goto L1060;
    }
    if (s_cmp(ch, next, 4L, 16L) == 0) {
	goto L110;
    }
    combin_ .icoe = ii;
    intepr_(&c__5, &c__1, ch, ch1, 80L, 160L);
    s_rsle(&io___592);
    do_lio(&c__9, &c__1, idat, 16L);
    for (l = 1; l <= 20; ++l) {
	do_lio(&c__5, &c__1, (char *)& combin_ .ratio[ii + l * 100 - 101], (
		ftnlen)sizeof(doublereal));
	do_lio(&c__9, &c__1, icel + (ii + l * 100 - 101 << 4), 16L);
    }
    e_rsle();
    i__1 = str_ .il;
    for (j = 1; j <= i__1; ++j) {
	if (s_cmp(idat, linopc_ .bez + (j - 1 << 4), 16L, 16L) != 0) {
	    goto L1070;
	}
	ell_ .kp[j - 1] = 5;
	combin_ .icomb0[ii - 1] = j;
	combin_ .ratioe[j - 1] = 1.;
L1070:
	for (l = 1; l <= 20; ++l) {
	    if (s_cmp(linopc_ .bez + (j - 1 << 4), icel + (ii + l * 100 - 101 
		    << 4), 16L, 16L) == 0) {
		combin_ .icomb[ii + l * 100 - 101] = j;
		combin_ .ratioe[j - 1] = combin_ .ratio[ii + l * 100 - 101];
	    }
 
	}
    }
    jj = combin_ .icomb0[ii - 1];
    if (jj == 0) {
	goto L1050;
    }
    for (m = 1; m <= 20; ++m) {
	ico = combin_ .icomb[ii + m * 100 - 101];
	if (ico == jj) {
	    error_(&c__92);
	}
	if (ico == 0) {
	    goto L1090;
	}
	s_wsfe(&io___594);
	do_fio(&c__1, linopc_ .bez + (jj - 1 << 4), 16L);
	do_fio(&c__1, linopc_ .bez + (ico - 1 << 4), 16L);
	do_fio(&c__1, (char *)& combin_ .ratio[ii + m * 100 - 101], (ftnlen)
		sizeof(doublereal));
	e_wsfe();
	combin_ .iratioe[ico - 1] = jj;
	if (ell_ .el[jj - 1] <= 1e-17) {
	    if (ell_ .el[ico - 1] <= 1e-17) {
		ell_ .ed[ico - 1] = ell_ .ed[jj - 1];
	    } else {
		ell_ .ek[ico - 1] = ell_ .ed[jj - 1] * combin_ .ratio[ii + m *
			 100 - 101];
	    }
	} else {
	    if (ell_ .el[ico - 1] <= 1e-17) {
		ell_ .ed[ico - 1] = ell_ .ek[jj - 1];
	    } else {
		ell_ .ek[ico - 1] = ell_ .ek[jj - 1] * combin_ .ratio[ii + m *
			 100 - 101];
	    }
	}
L1090:
	;
    }
    goto L1050;
L1100:
    s_wsfe(&io___595);
    do_fio(&c__1, (char *)&c__100, (ftnlen)sizeof(integer));
    e_wsfe();
    goto L110;
 

 
 

L1110:
    erro_ .ierro = s_rsfe(&io___596);
    if (erro_ .ierro != 0) {
	goto L100061;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100061;
    }
    erro_ .ierro = e_rsfe();
L100061:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch == '/') {
	goto L1110;
    }
 
    i__2[0] = 80, a__1[0] = ch;
    i__2[1] = 3, a__1[1] = " / ";
    s_cat(ch1, a__1, i__2, &c__2, 83L);
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    erro_ .ierro = s_wsle(&io___597);
    if (erro_ .ierro != 0) {
	goto L100062;
    }
    erro_ .ierro = do_lio(&c__9, &c__1, ch1, 160L);
    if (erro_ .ierro != 0) {
	goto L100062;
    }
    erro_ .ierro = e_wsle();
L100062:
    if (erro_ .ierro != 0) {
	error_(&c__59);
    }
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    s_rsle(&io___598);
    do_lio(&c__3, &c__1, (char *)& subres_ .nta, (ftnlen)sizeof(integer));
    do_lio(&c__3, &c__1, (char *)& subres_ .nte, (ftnlen)sizeof(integer));
    do_lio(&c__5, &c__1, (char *)& subres_ .qxt, (ftnlen)sizeof(doublereal));
    do_lio(&c__5, &c__1, (char *)& subres_ .qzt, (ftnlen)sizeof(doublereal));
    do_lio(&c__5, &c__1, (char *)& subres_ .tam1, (ftnlen)sizeof(doublereal));
    do_lio(&c__5, &c__1, (char *)& subres_ .tam2, (ftnlen)sizeof(doublereal));
    do_lio(&c__3, &c__1, (char *)& subres_ .ipt, (ftnlen)sizeof(integer));
    do_lio(&c__5, &c__1, (char *)& subres_ .totl, (ftnlen)sizeof(doublereal));
    e_rsle();
    if (subres_ .nta < 2) {
	error_(&c__37);
    }
    if (subres_ .nte < subres_ .nta || subres_ .nte > 9) {
	error_(&c__37);
    }
    subres_ .isub = 1;
    goto L110;
 

 
 

L1120:
    erro_ .ierro = s_rsfe(&io___599);
    if (erro_ .ierro != 0) {
	goto L100063;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100063;
    }
    erro_ .ierro = e_rsfe();
L100063:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch == '/') {
	goto L1120;
    }
 
    i__2[0] = 80, a__1[0] = ch;
    i__2[1] = 3, a__1[1] = " / ";
    s_cat(ch1, a__1, i__2, &c__2, 83L);
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    erro_ .ierro = s_wsle(&io___600);
    if (erro_ .ierro != 0) {
	goto L100064;
    }
    erro_ .ierro = do_lio(&c__9, &c__1, ch1, 160L);
    if (erro_ .ierro != 0) {
	goto L100064;
    }
    erro_ .ierro = e_wsle();
L100064:
    if (erro_ .ierro != 0) {
	error_(&c__59);
    }
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    s_rsle(&io___601);
    do_lio(&c__3, &c__1, (char *)& secom1_ .nre, (ftnlen)sizeof(integer));
    e_rsle();
    if (secom1_ .nre != 0) {
	al__1.aerr = 0;
	al__1.aunit = 11;
	f_rew(&al__1);
	s_rsle(&io___602);
	do_lio(&c__3, &c__1, (char *)& secom1_ .nre, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& secom1_ .npp, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& secom1_ .nrr[0], (ftnlen)sizeof(integer)
		);
	do_lio(&c__3, &c__1, (char *)& secom1_ .nrr[1], (ftnlen)sizeof(integer)
		);
	do_lio(&c__3, &c__1, (char *)& secom1_ .nrr[2], (ftnlen)sizeof(integer)
		);
	do_lio(&c__3, &c__1, (char *)& secom_ .ipr[0], (ftnlen)sizeof(integer))
		;
	do_lio(&c__3, &c__1, (char *)& secom_ .ipr[1], (ftnlen)sizeof(integer))
		;
	do_lio(&c__3, &c__1, (char *)& secom_ .ipr[2], (ftnlen)sizeof(integer))
		;
	e_rsle();
    }
    if (secom1_ .nre != 0 && (secom1_ .npp < 2 || secom1_ .npp > 5)) {
	error_(&c__46);
    }
    if (secom1_ .nre < 0 || secom1_ .nre > 3) {
	error_(&c__47);
    }
    if ((( secom1_ .nrr[0] ) >= 0 ? ( secom1_ .nrr[0] ) : -( secom1_ .nrr[0] ))  > secom1_ .npp || (( secom1_ .nrr[1] ) >= 0 ? ( secom1_ .nrr[1] ) : -( secom1_ .nrr[1] ))  > 
	    secom1_ .npp || (( secom1_ .nrr[2] ) >= 0 ? ( secom1_ .nrr[2] ) : -( secom1_ .nrr[2] ))  > secom1_ .npp) {
	error_(&c__48);
    }
L1130:
    erro_ .ierro = s_rsfe(&io___603);
    if (erro_ .ierro != 0) {
	goto L100065;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100065;
    }
    erro_ .ierro = e_rsfe();
L100065:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch == '/') {
	goto L1130;
    }
 
    i__2[0] = 80, a__1[0] = ch;
    i__2[1] = 3, a__1[1] = " / ";
    s_cat(ch1, a__1, i__2, &c__2, 83L);
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    erro_ .ierro = s_wsle(&io___604);
    if (erro_ .ierro != 0) {
	goto L100066;
    }
    erro_ .ierro = do_lio(&c__9, &c__1, ch1, 160L);
    if (erro_ .ierro != 0) {
	goto L100066;
    }
    erro_ .ierro = e_wsle();
L100066:
    if (erro_ .ierro != 0) {
	error_(&c__59);
    }
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    s_rsle(&io___605);
    do_lio(&c__3, &c__1, (char *)& secom1_ .nur, (ftnlen)sizeof(integer));
    e_rsle();
    if (secom1_ .nur != 0) {
	al__1.aerr = 0;
	al__1.aunit = 11;
	f_rew(&al__1);
	s_rsle(&io___606);
	do_lio(&c__3, &c__1, (char *)& secom1_ .nur, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& secom1_ .nu[0], (ftnlen)sizeof(integer))
		;
	do_lio(&c__3, &c__1, (char *)& secom1_ .nu[1], (ftnlen)sizeof(integer))
		;
	do_lio(&c__3, &c__1, (char *)& secom1_ .nu[2], (ftnlen)sizeof(integer))
		;
	e_rsle();
    }
    if (secom1_ .nur < 0 || secom1_ .nur > 3) {
	error_(&c__49);
    }
    if (secom1_ .nu[0] > 9 || secom1_ .nu[1] > 9 || secom1_ .nu[2] > 9 || 
	    secom1_ .nu[0] < 0 || secom1_ .nu[1] < 0 || secom1_ .nu[2] < 0) {
	error_(&c__50);
    }
L1140:
    erro_ .ierro = s_rsfe(&io___607);
    if (erro_ .ierro != 0) {
	goto L100067;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100067;
    }
    erro_ .ierro = e_rsfe();
L100067:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch == '/') {
	goto L1140;
    }
 
    i__2[0] = 80, a__1[0] = ch;
    i__2[1] = 3, a__1[1] = " / ";
    s_cat(ch1, a__1, i__2, &c__2, 83L);
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    erro_ .ierro = s_wsle(&io___608);
    if (erro_ .ierro != 0) {
	goto L100068;
    }
    erro_ .ierro = do_lio(&c__9, &c__1, ch1, 160L);
    if (erro_ .ierro != 0) {
	goto L100068;
    }
    erro_ .ierro = e_wsle();
L100068:
    if (erro_ .ierro != 0) {
	error_(&c__59);
    }
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    s_rsle(&io___609);
    do_lio(&c__5, &c__1, (char *)& subres_ .totl, (ftnlen)sizeof(doublereal));
    do_lio(&c__5, &c__1, (char *)& subres_ .qxt, (ftnlen)sizeof(doublereal));
    do_lio(&c__5, &c__1, (char *)& subres_ .qzt, (ftnlen)sizeof(doublereal));
    do_lio(&c__5, &c__1, (char *)& subres_ .tam1, (ftnlen)sizeof(doublereal));
    do_lio(&c__5, &c__1, (char *)& subres_ .tam2, (ftnlen)sizeof(doublereal));
    e_rsle();
L1150:
    erro_ .ierro = s_rsfe(&io___610);
    if (erro_ .ierro != 0) {
	goto L100069;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100069;
    }
    erro_ .ierro = e_rsfe();
L100069:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch == '/') {
	goto L1150;
    }
    intepr_(&c__3, &c__1, ch, ch1, 80L, 160L);
    s_rsle(&io___611);
    for (i__ = 1; i__ <= 6; ++i__) {
	do_lio(&c__9, &c__1, ilm0 + (i__ - 1 << 4), 16L);
    }
    e_rsle();
L1160:
    erro_ .ierro = s_rsfe(&io___612);
    if (erro_ .ierro != 0) {
	goto L100070;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100070;
    }
    erro_ .ierro = e_rsfe();
L100070:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch == '/') {
	goto L1160;
    }
    intepr_(&c__6, &c__1, ch, ch1, 80L, 160L);
    s_rsle(&io___613);
    do_lio(&c__3, &c__1, (char *)& secom1_ .nch, (ftnlen)sizeof(integer));
    e_rsle();
    if (secom1_ .nch != 0) {
	al__1.aerr = 0;
	al__1.aunit = 11;
	f_rew(&al__1);
	s_rsle(&io___614);
	do_lio(&c__3, &c__1, (char *)& secom1_ .nch, (ftnlen)sizeof(integer));
	do_lio(&c__9, &c__1, ilm0 + 96, 16L);
	do_lio(&c__9, &c__1, ilm0 + 112, 16L);
	e_rsle();
    }
L1170:
    erro_ .ierro = s_rsfe(&io___615);
    if (erro_ .ierro != 0) {
	goto L100071;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100071;
    }
    erro_ .ierro = e_rsfe();
L100071:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch == '/') {
	goto L1170;
    }
    intepr_(&c__7, &c__1, ch, ch1, 80L, 160L);
    s_rsle(&io___616);
    do_lio(&c__3, &c__1, (char *)& secom1_ .nqc, (ftnlen)sizeof(integer));
    e_rsle();
    if (secom1_ .nqc != 0) {
	al__1.aerr = 0;
	al__1.aunit = 11;
	f_rew(&al__1);
	s_rsle(&io___617);
	do_lio(&c__3, &c__1, (char *)& secom1_ .nqc, (ftnlen)sizeof(integer));
	do_lio(&c__9, &c__1, ilm0 + 128, 16L);
	do_lio(&c__9, &c__1, ilm0 + 144, 16L);
	do_lio(&c__5, &c__3, (char *)& qmodi_ .qw0[0], (ftnlen)sizeof(
		doublereal));
	e_rsle();
    }
    for (k = 1; k <= 10; ++k) {
	i__1 = str_ .il;
	for (j = 1; j <= i__1; ++j) {
	    if (s_cmp(ilm0 + (k - 1 << 4), linopc_ .bez + (j - 1 << 4), 16L, 
		    16L) != 0) {
		goto L1180;
	    }
	    secom_ .ire[k - 1] = j;
	    if (secom1_ .nre == 1 && k < 3 && (i__3 = ell_ .kz[j - 1], (( 
		    i__3 ) >= 0 ? (  		    i__3 ) : -(  		    i__3 )) ) != secom1_ .npp) {
		error_(&c__39);
	    }
	    if (secom1_ .nre == 2 && k < 5 && (i__3 = ell_ .kz[j - 1], (( 
		    i__3 ) >= 0 ? (  		    i__3 ) : -(  		    i__3 )) ) != secom1_ .npp) {
		error_(&c__39);
	    }
	    if (secom1_ .nre == 3 && k < 7 && (i__3 = ell_ .kz[j - 1], (( 
		    i__3 ) >= 0 ? (  		    i__3 ) : -(  		    i__3 )) ) != secom1_ .npp) {
		error_(&c__39);
	    }
	    if (secom1_ .nch == 1 && (k == 7 || k == 8) && ell_ .kz[j - 1] != 
		    3) {
		error_(&c__11);
	    }
	    if (secom1_ .nqc == 1 && (k == 9 || k == 10) && ell_ .kz[j - 1] !=
		     2) {
		error_(&c__8);
	    }
	    goto L1190;
L1180:
	    ;
	}
	if (secom1_ .nre == 1 && k < 3 || secom1_ .nre == 2 && k < 5 || 
		secom1_ .nre == 3 && k < 7 || secom1_ .nch == 1 && (k == 7 || 
		k == 8) || secom1_ .nqc == 1 && (k == 9 || k == 10)) {
	    error_(&c__3);
	}
L1190:
	;
    }
    secom_ .irmod2 = 1;
    goto L110;
 

 
 

L1200:
    erro_ .ierro = s_rsfe(&io___618);
    if (erro_ .ierro != 0) {
	goto L100072;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100072;
    }
    erro_ .ierro = e_rsfe();
L100072:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch == '/') {
	goto L1200;
    }
 
    i__2[0] = 80, a__1[0] = ch;
    i__2[1] = 3, a__1[1] = " / ";
    s_cat(ch1, a__1, i__2, &c__2, 83L);
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    erro_ .ierro = s_wsle(&io___619);
    if (erro_ .ierro != 0) {
	goto L100073;
    }
    erro_ .ierro = do_lio(&c__9, &c__1, ch1, 160L);
    if (erro_ .ierro != 0) {
	goto L100073;
    }
    erro_ .ierro = e_wsle();
L100073:
    if (erro_ .ierro != 0) {
	error_(&c__59);
    }
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    s_rsle(&io___620);
    do_lio(&c__5, &c__1, (char *)& subres_ .qxt, (ftnlen)sizeof(doublereal));
    do_lio(&c__5, &c__1, (char *)& subres_ .qzt, (ftnlen)sizeof(doublereal));
    do_lio(&c__5, &c__1, (char *)& subres_ .tam1, (ftnlen)sizeof(doublereal));
    do_lio(&c__5, &c__1, (char *)& subres_ .tam2, (ftnlen)sizeof(doublereal));
    do_lio(&c__5, &c__1, (char *)& subres_ .totl, (ftnlen)sizeof(doublereal));
    e_rsle();
L1210:
    erro_ .ierro = s_rsfe(&io___621);
    if (erro_ .ierro != 0) {
	goto L100074;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100074;
    }
    erro_ .ierro = e_rsfe();
L100074:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch == '/') {
	goto L1210;
    }
 
    i__2[0] = 80, a__1[0] = ch;
    i__2[1] = 3, a__1[1] = " / ";
    s_cat(ch1, a__1, i__2, &c__2, 83L);
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    erro_ .ierro = s_wsle(&io___622);
    if (erro_ .ierro != 0) {
	goto L100075;
    }
    erro_ .ierro = do_lio(&c__9, &c__1, ch1, 160L);
    if (erro_ .ierro != 0) {
	goto L100075;
    }
    erro_ .ierro = e_wsle();
L100075:
    if (erro_ .ierro != 0) {
	error_(&c__59);
    }
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    s_rsle(&io___623);
    do_lio(&c__3, &c__1, (char *)& sea_ .mesa, (ftnlen)sizeof(integer));
    do_lio(&c__3, &c__1, (char *)& sea_ .mp, (ftnlen)sizeof(integer));
    do_lio(&c__3, &c__1, (char *)& sea_ .m21, (ftnlen)sizeof(integer));
    do_lio(&c__3, &c__1, (char *)& sea_ .m22, (ftnlen)sizeof(integer));
    do_lio(&c__3, &c__1, (char *)& sea_ .m23, (ftnlen)sizeof(integer));
    do_lio(&c__3, &c__1, (char *)& sea_ .ise1, (ftnlen)sizeof(integer));
    do_lio(&c__3, &c__1, (char *)& sea_ .ise2, (ftnlen)sizeof(integer));
    do_lio(&c__3, &c__1, (char *)& sea_ .ise3, (ftnlen)sizeof(integer));
    e_rsle();
    if (sea_ .mp < 2 || sea_ .mp > 9) {
	error_(&c__37);
    }
    if ((( sea_ .m21 ) >= 0 ? ( sea_ .m21 ) : -( sea_ .m21 ))  > sea_ .mp || (( sea_ .m22 ) >= 0 ? ( sea_ .m22 ) : -( sea_ .m22 ))  > sea_ .mp || (( 
	    sea_ .m23 ) >= 0 ? (  	    sea_ .m23 ) : -(  	    sea_ .m23 ))  > sea_ .mp) {
	error_(&c__48);
    }
    sea_ .ise = 1;
    k0 = 0;
L1220:
    for (m = 1; m <= 40; ++m) {
 
	s_copy(ilm0 + (m - 1 << 4), idum, 16L, 16L);
    }
L1240:
    erro_ .ierro = s_rsfe(&io___624);
    if (erro_ .ierro != 0) {
	goto L100076;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100076;
    }
    erro_ .ierro = e_rsfe();
L100076:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch == '/') {
	goto L1240;
    }
    intepr_(&c__3, &c__1, ch, ch1, 80L, 160L);
    s_rsle(&io___625);
    do_lio(&c__9, &c__1, idat, 16L);
    for (m = 2; m <= 40; ++m) {
	do_lio(&c__9, &c__1, ilm0 + (m - 1 << 4), 16L);
    }
    e_rsle();
    if (s_cmp(idat, next, 16L, 16L) == 0) {
	goto L110;
    }
    s_copy(ilm0, idat, 16L, 16L);
    ka = k0 + 1;
    ke = k0 + 40;
    i__1 = ke;
    for (k = ka; k <= i__1; ++k) {
	if (k > 700) {
	    error_(&c__2);
	}
	if (k > sea_ .mesa) {
	    goto L110;
	}
	ki = k - k0;
	if (s_cmp(ilm0 + (ki - 1 << 4), idum, 16L, 16L) == 0) {
	    goto L1270;
	}
	i__3 = str_ .il;
	for (j = 1; j <= i__3; ++j) {
	    if (s_cmp(ilm0 + (ki - 1 << 4), linopc_ .bez + (j - 1 << 4), 16L, 
		    16L) != 0) {
		goto L1250;
	    }
	    sea_ .isea[k - 1] = j;
	    if ((i__4 = ell_ .kz[j - 1], (( i__4 ) >= 0 ? ( i__4 ) : -( i__4 )) ) != sea_ .mp) {
		error_(&c__39);
	    }
	    goto L1260;
L1250:
	    ;
	}
	error_(&c__3);
L1260:
	;
    }
L1270:
    k0 = k - 1;
    goto L1220;
 

 
 

L1280:
    erro_ .ierro = s_rsfe(&io___627);
    if (erro_ .ierro != 0) {
	goto L100077;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100077;
    }
    erro_ .ierro = e_rsfe();
L100077:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch != '/') {
	++iclr;
    } else {
	goto L1280;
    }
 
    i__2[0] = 80, a__1[0] = ch;
    i__2[1] = 3, a__1[1] = " / ";
    s_cat(ch1, a__1, i__2, &c__2, 83L);
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    erro_ .ierro = s_wsle(&io___628);
    if (erro_ .ierro != 0) {
	goto L100078;
    }
    erro_ .ierro = do_lio(&c__9, &c__1, ch1, 160L);
    if (erro_ .ierro != 0) {
	goto L100078;
    }
    erro_ .ierro = e_wsle();
L100078:
    if (erro_ .ierro != 0) {
	error_(&c__59);
    }
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    if (iclr == 1) {
	s_copy(posti3_ .toptit, ch, 80L, 80L);
    }
    if (iclr == 2) {
	s_rsle(&io___629);
	do_lio(&c__3, &c__1, (char *)& posti1_ .iav, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& postr_ .nstart, (ftnlen)sizeof(integer))
		;
	do_lio(&c__3, &c__1, (char *)& postr_ .nstop, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& posti1_ .iwg, (ftnlen)sizeof(integer));
	do_lio(&c__5, &c__1, (char *)& postr_ .dphix, (ftnlen)sizeof(
		doublereal));
	do_lio(&c__5, &c__1, (char *)& postr_ .dphiz, (ftnlen)sizeof(
		doublereal));
	do_lio(&c__3, &c__1, (char *)& postr_ .iskip, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& postr_ .iconv, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& postr_ .imad, (ftnlen)sizeof(integer));
	do_lio(&c__5, &c__1, (char *)& postr_ .cma1, (ftnlen)sizeof(doublereal)
		);
	do_lio(&c__5, &c__1, (char *)& postr_ .cma2, (ftnlen)sizeof(doublereal)
		);
	e_rsle();
    }
    if (iclr == 3) {
	s_rsle(&io___630);
	do_lio(&c__5, &c__1, (char *)& postr_ .qx0, (ftnlen)sizeof(doublereal))
		;
	do_lio(&c__5, &c__1, (char *)& postr_ .qz0, (ftnlen)sizeof(doublereal))
		;
	do_lio(&c__3, &c__1, (char *)& posti1_ .ivox, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& posti1_ .ivoz, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& posti1_ .ires, (ftnlen)sizeof(integer));
	do_lio(&c__5, &c__1, (char *)& postr_ .dres, (ftnlen)sizeof(doublereal)
		);
	do_lio(&c__3, &c__1, (char *)& posti1_ .ifh, (ftnlen)sizeof(integer));
	do_lio(&c__5, &c__1, (char *)& postr_ .dfft, (ftnlen)sizeof(doublereal)
		);
	e_rsle();
    }
    if (iclr == 4) {
	s_rsle(&io___631);
	do_lio(&c__3, &c__1, (char *)& posti2_ .kwtype, (ftnlen)sizeof(integer)
		);
	do_lio(&c__3, &c__1, (char *)& posti2_ .itf, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& posti2_ .icr, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& posti2_ .idis, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& posti2_ .icow, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& posti2_ .istw, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& posti2_ .iffw, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& posti2_ .nprint, (ftnlen)sizeof(integer)
		);
	do_lio(&c__3, &c__1, (char *)& posti2_ .ndafi, (ftnlen)sizeof(integer))
		;
	e_rsle();
    }
    if (postr_ .iskip <= 0) {
	postr_ .iskip = 1;
    }
    if (iclr != 4) {
	goto L1280;
    }
    if (posti2_ .nprint != 1) {
	posti2_ .nprint = 0;
    }
    iclr = 0;
    if (postr_ .nstart < 0) {
	postr_ .nstart = 0;
    }
    if (postr_ .nstop < 0) {
	postr_ .nstop = 0;
    }
    if (postr_ .nstop < postr_ .nstart) {
	postr_ .nstart = 0;
	postr_ .nstop = 0;
    }
    if (posti2_ .itf == -1) {
	posti2_ .itf = -20;
    }
    if (posti2_ .itf == 1) {
	posti2_ .itf = 20;
    }
    if (posti2_ .itf == 0) {
	posti2_ .itf = 0;
    }
    if (postr_ .iconv != 1) {
	postr_ .iconv = 0;
    }
    if ((( postr_ .cma1 ) >= 0 ? ( postr_ .cma1 ) : -( postr_ .cma1 ))  <= 1e-17) {
	postr_ .cma1 = 1.;
    }
    postr_ .cma1 *= 1e3;
    if ((( postr_ .cma2 ) >= 0 ? ( postr_ .cma2 ) : -( postr_ .cma2 ))  <= 1e-17) {
	postr_ .cma2 = 1.;
    }
    posti1_ .ipos = 1;
    goto L110;
 

 
 

L1290:
    ripp_ .irip = 1;
L1300:
    erro_ .ierro = s_rsfe(&io___632);
    if (erro_ .ierro != 0) {
	goto L100079;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100079;
    }
    erro_ .ierro = e_rsfe();
L100079:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch == '/') {
	goto L1300;
    }
    if (s_cmp(ch, next, 4L, 16L) == 0) {
	goto L110;
    }
    intepr_(&c__1, &c__1, ch, ch1, 80L, 160L);
    ++ ripp_ .irco;
    if (ripp_ .irco > 700) {
	error_(&c__51);
    }
    s_rsle(&io___633);
    do_lio(&c__9, &c__1, idat, 16L);
    do_lio(&c__5, &c__1, (char *)&ram, (ftnlen)sizeof(doublereal));
    do_lio(&c__5, &c__1, (char *)&rfr, (ftnlen)sizeof(doublereal));
    do_lio(&c__5, &c__1, (char *)&rph, (ftnlen)sizeof(doublereal));
    do_lio(&c__3, &c__1, (char *)& ripp2_ .nrturn, (ftnlen)sizeof(integer));
    e_rsle();
    i__1 = str_ .il;
    for (j = 1; j <= i__1; ++j) {
	if (s_cmp(idat, linopc_ .bez + (j - 1 << 4), 16L, 16L) == 0) {
	    ripp_ .nrel[ripp_ .irco - 1] = j;
	    ripp_ .ramp[j - 1] = ram;
	    ripp_ .rfre[j - 1] = rfr;
	    ripp_ .rzph[j - 1] = rph;
	    goto L1300;
	}
 
    }
    goto L1300;
 

 
 

L1320:
    skew_ .iskew = 1;
L1330:
    erro_ .ierro = s_rsfe(&io___637);
    if (erro_ .ierro != 0) {
	goto L100080;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100080;
    }
    erro_ .ierro = e_rsfe();
L100080:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch == '/') {
	goto L1330;
    }
    intepr_(&c__3, &c__1, ch, ch1, 80L, 160L);
    s_rsle(&io___638);
    do_lio(&c__9, &c__1, idat, 16L);
    for (m = 2; m <= 4; ++m) {
	do_lio(&c__9, &c__1, ilm0 + (m - 1 << 4), 16L);
    }
    e_rsle();
    if (s_cmp(idat, next, 16L, 16L) == 0) {
	skew_ .iskew = 0;
	goto L110;
    }
    s_copy(ilm0, idat, 16L, 16L);
    for (i__ = 1; i__ <= 2; ++i__) {
L1340:
	erro_ .ierro = s_rsfe(&io___639);
	if (erro_ .ierro != 0) {
	    goto L100081;
	}
	erro_ .ierro = do_fio(&c__1, ch, 80L);
	if (erro_ .ierro != 0) {
	    goto L100081;
	}
	erro_ .ierro = e_rsfe();
L100081:
	if (erro_ .ierro < 0) {
	    goto L1530;
	}
	if (erro_ .ierro > 0) {
	    error_(&c__58);
	}
	if (*(unsigned char *)ch == '/') {
	    goto L1340;
	}
	if (s_cmp(ch, next, 4L, 16L) == 0) {
	    skew_ .iskew = 2;
	    goto L1360;
	}
	intepr_(&c__1, &c__1, ch, ch1, 80L, 160L);
	s_rsle(&io___640);
	do_lio(&c__9, &c__1, ilm0 + (i__ + 3 << 4), 16L);
	do_lio(&c__5, &c__1, (char *)& skew_ .qwsk[i__ - 1], (ftnlen)sizeof(
		doublereal));
	e_rsle();
 
    }
L1360:
    for (i__ = 1; i__ <= 6; ++i__) {
	i__1 = str_ .il;
	for (j = 1; j <= i__1; ++j) {
	    if (skew_ .iskew == 2 && i__ > 4) {
		goto L1380;
	    }
	    if (s_cmp(ilm0 + (i__ - 1 << 4), linopc_ .bez + (j - 1 << 4), 16L,
		     16L) == 0) {
		if (i__ <= 4) {
		    if (ell_ .kz[j - 1] != -2) {
			error_(&c__62);
		    }
		} else {
		    if (ell_ .kz[j - 1] != 2) {
			error_(&c__8);
		    }
		}
		skew_ .nskew[i__ - 1] = j;
		for (i2 = 1; i2 <= 6; ++i2) {
		    if (skew_ .nskew[i2 - 1] != 0 && skew_ .nskew[i2 - 1] == 
			    skew_ .nskew[i__ - 1] && i2 != i__) {
			error_(&c__63);
		    }
 
		}
	    }
L1380:
	    ;
	}
    }
    goto L110;
 

 
 

L1390:
    erro_ .ierro = s_rsfe(&io___641);
    if (erro_ .ierro != 0) {
	goto L100082;
    }
    erro_ .ierro = do_fio(&c__1, titc_ .commen, 80L);
    if (erro_ .ierro != 0) {
	goto L100082;
    }
    erro_ .ierro = e_rsfe();
L100082:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)titc_ .commen == '/') {
	goto L1390;
    }
    if (s_cmp(titc_ .commen, next, 4L, 16L) == 0) {
	s_copy(titc_ .commen, " ", 80L, 1L);
    }
    goto L110;
 

 
 

L1400:
    erro_ .ierro = s_rsfe(&io___642);
    if (erro_ .ierro != 0) {
	goto L100083;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100083;
    }
    erro_ .ierro = e_rsfe();
L100083:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch == '/') {
	goto L1400;
    }
    if (s_cmp(ch, next, 4L, 16L) == 0) {
	goto L110;
    } else {
	if (dial_ .idial == 0 && tra1_ .numl != 0) {
	    s_wsfe(&io___643);
	    e_wsfe();
	    s_wsle(&io___644);
	    e_wsle();
	    error_(&c__78);
	}
	norf_ .inorm = 1;
 
	i__2[0] = 80, a__1[0] = ch;
	i__2[1] = 3, a__1[1] = " / ";
	s_cat(ch1, a__1, i__2, &c__2, 83L);
	al__1.aerr = 0;
	al__1.aunit = 11;
	f_rew(&al__1);
	erro_ .ierro = s_wsle(&io___645);
	if (erro_ .ierro != 0) {
	    goto L100084;
	}
	erro_ .ierro = do_lio(&c__9, &c__1, ch1, 160L);
	if (erro_ .ierro != 0) {
	    goto L100084;
	}
	erro_ .ierro = e_wsle();
L100084:
	if (erro_ .ierro != 0) {
	    error_(&c__59);
	}
	al__1.aerr = 0;
	al__1.aunit = 11;
	f_rew(&al__1);
	s_rsle(&io___646);
	do_lio(&c__3, &c__1, (char *)& norf_ .nordf, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& norf_ .nvarf, (ftnlen)sizeof(integer));
	e_rsle();
	if (dial_ .nord != 0 && norf_ .nordf > dial_ .nord + 1) {
	    norf_ .nordf = dial_ .nord + 1;
	    norf_ .imod1 = 1;
	}
	if (dial_ .nvar != 0 && norf_ .nvarf > dial_ .nvar) {
	    norf_ .nvarf = dial_ .nvar;
	    norf_ .imod2 = 1;
	}
    }
 

 
 

L1410:
    erro_ .ierro = s_rsfe(&io___647);
    if (erro_ .ierro != 0) {
	goto L100085;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100085;
    }
    erro_ .ierro = e_rsfe();
L100085:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch == '/') {
	goto L1410;
    }
    if (s_cmp(ch, next, 4L, 16L) == 0) {
	goto L110;
    }
    tcorr_ .icorr = 1;
 
    i__2[0] = 80, a__1[0] = ch;
    i__2[1] = 3, a__1[1] = " / ";
    s_cat(ch1, a__1, i__2, &c__2, 83L);
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    erro_ .ierro = s_wsle(&io___648);
    if (erro_ .ierro != 0) {
	goto L100086;
    }
    erro_ .ierro = do_lio(&c__9, &c__1, ch1, 160L);
    if (erro_ .ierro != 0) {
	goto L100086;
    }
    erro_ .ierro = e_wsle();
L100086:
    if (erro_ .ierro != 0) {
	error_(&c__59);
    }
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    s_rsle(&io___649);
    do_lio(&c__3, &c__1, (char *)& tcorr_ .nctype, (ftnlen)sizeof(integer));
    do_lio(&c__3, &c__1, (char *)& dial_ .ncor, (ftnlen)sizeof(integer));
    e_rsle();
    if (dial_ .ncor > 10) {
	error_(&c__65);
    }
    if (dial_ .ncor > 0) {
	erro_ .ierro = s_rsfe(&io___650);
	if (erro_ .ierro != 0) {
	    goto L100087;
	}
	erro_ .ierro = do_fio(&c__1, ch, 80L);
	if (erro_ .ierro != 0) {
	    goto L100087;
	}
	erro_ .ierro = e_rsfe();
L100087:
	if (erro_ .ierro < 0) {
	    goto L1530;
	}
 
	i__2[0] = 80, a__1[0] = ch;
	i__2[1] = 3, a__1[1] = " / ";
	s_cat(ch1, a__1, i__2, &c__2, 83L);
	intepr_(&c__3, &c__1, ch, ch1, 80L, 160L);
	s_rsle(&io___651);
	i__1 = dial_ .ncor;
	for (i__ = 1; i__ <= i__1; ++i__) {
	    do_lio(&c__9, &c__1, tcorrc_ .coel + (i__ - 1 << 4), 16L);
	}
	e_rsle();
	i__1 = dial_ .ncor;
	for (j1 = 1; j1 <= i__1; ++j1) {
	    i__3 = str_ .il;
	    for (j2 = 1; j2 <= i__3; ++j2) {
		if (s_cmp(tcorrc_ .coel + (j1 - 1 << 4), linopc_ .bez + (j2 - 
			1 << 4), 16L, 16L) == 0) {
		    if (ell_ .el[j2 - 1] != 0. || ell_ .kz[j2 - 1] > 10) {
			error_(&c__67);
		    }
		    dial_ .ipar[j1 - 1] = j2;
		    goto L1430;
		}
 
	    }
	    error_(&c__66);
L1430:
	    ;
	}
    } else {
	error_(&c__70);
    }
    if (tcorr_ .nctype == 0) {
	s_rsle(&io___652);
	do_lio(&c__3, &c__1, (char *)& tcorr_ .namp, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& tcorr_ .nmom, (ftnlen)sizeof(integer));
	do_lio(&c__5, &c__1, (char *)&dummy, (ftnlen)sizeof(doublereal));
	do_lio(&c__5, &c__1, (char *)&dummy, (ftnlen)sizeof(doublereal));
	do_lio(&c__5, &c__1, (char *)&dummy, (ftnlen)sizeof(doublereal));
	e_rsle();
	if (tcorr_ .namp + tcorr_ .nmom == 0) {
	    error_(&c__71);
	}
	if (tcorr_ .namp * tcorr_ .nmom != 0) {
	    error_(&c__72);
	}
	if (tcorr_ .namp < 0 || tcorr_ .namp > 2) {
	    error_(&c__73);
	}
	if (tcorr_ .nmom < 0 || tcorr_ .nmom == 1 || tcorr_ .nmom > 3) {
	    error_(&c__74);
	}
	if (tcorr_ .namp == 1 || tcorr_ .nmom == 2) {
	    dial_ .nord = 6;
	} else {
	    dial_ .nord = 7;
	}
    } else {
	s_rsle(&io___653);
	do_lio(&c__3, &c__1, (char *)& tcorr_ .nmom1, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& tcorr_ .nmom2, (ftnlen)sizeof(integer));
	do_lio(&c__5, &c__1, (char *)& tcorr_ .weig1, (ftnlen)sizeof(
		doublereal));
	do_lio(&c__5, &c__1, (char *)& tcorr_ .weig2, (ftnlen)sizeof(
		doublereal));
	do_lio(&c__5, &c__1, (char *)& tcorr_ .dpmax, (ftnlen)sizeof(
		doublereal));
	e_rsle();
	if (tcorr_ .nmom1 < 2 || tcorr_ .nmom1 > 3) {
	    error_(&c__75);
	}
	if (tcorr_ .nmom1 > tcorr_ .nmom2) {
	    error_(&c__76);
	}
	if (tcorr_ .nmom2 < 2 || tcorr_ .nmom2 > 3) {
	    error_(&c__77);
	}
	dial_ .nord = tcorr_ .nmom2 + 1 << 1;
    }
 

    dial_ .idial = 1;
    tra1_ .numlr = 0;
 
    tra1_ .napx = 1;
    tra1_ .imc = 1;
    dial_ .preda = 1e-38;
    dial_ .nsix = 1;
    dial_ .nvar = 5;
    dial_ .nvar2 = dial_ .nvar;
    dial_ .nvar = dial_ .nvar2 + dial_ .ncor;
 

    norf_ .inorm = 1;
    norf_ .nordf = dial_ .nord + 1;
    norf_ .nvarf = dial_ .nvar;
 

    goto L1410;
 

 
 

L1600:
    erro_ .ierro = s_rsfe(&io___654);
    if (erro_ .ierro != 0) {
	goto L100088;
    }
    erro_ .ierro = do_fio(&c__1, ch, 80L);
    if (erro_ .ierro != 0) {
	goto L100088;
    }
    erro_ .ierro = e_rsfe();
L100088:
    if (erro_ .ierro < 0) {
	goto L1530;
    }
    if (erro_ .ierro > 0) {
	error_(&c__58);
    }
    if (*(unsigned char *)ch == '/') {
	goto L1600;
    }
    if (s_cmp(ch, next, 4L, 16L) == 0) {
	goto L110;
    }
 
    i__2[0] = 80, a__1[0] = ch;
    i__2[1] = 3, a__1[1] = " / ";
    s_cat(ch1, a__1, i__2, &c__2, 83L);
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    erro_ .ierro = s_wsle(&io___655);
    if (erro_ .ierro != 0) {
	goto L100089;
    }
    erro_ .ierro = do_lio(&c__9, &c__1, ch1, 160L);
    if (erro_ .ierro != 0) {
	goto L100089;
    }
    erro_ .ierro = e_wsle();
L100089:
    if (erro_ .ierro != 0) {
	error_(&c__59);
    }
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    s_rsle(&io___656);
    do_lio(&c__5, &c__1, (char *)& beam_ .partnum, (ftnlen)sizeof(doublereal));
    do_lio(&c__5, &c__1, (char *)& beam_ .emitnx, (ftnlen)sizeof(doublereal));
    do_lio(&c__5, &c__1, (char *)& beam_ .emitnz, (ftnlen)sizeof(doublereal));
    do_lio(&c__3, &c__1, (char *)& beam_ .ibeco, (ftnlen)sizeof(integer));
    do_lio(&c__3, &c__1, (char *)& beam_ .ibtyp, (ftnlen)sizeof(integer));
    e_rsle();
    if (beam_ .emitnx <= 1e-17 || beam_ .emitnz <= 1e-17) {
	error_(&c__88);
    }
    beam_ .nbeam = 1;
    if (beam_ .ibtyp == 1) {
	wzset_();
    }
    goto L110;
 

L771:
    if (tra1_ .napx >= 1) {
	if (syn_ .e0 < 1e-17 || syn_ .e0 <= syn_ .pma) {
	    error_(&c__27);
	}
	beam_ .gammar = syn_ .pma / syn_ .e0;
    }
    if (clo_ .iout == 0) {
	return 0;
    }
    s_wsfe(&io___657);
    e_wsfe();
    s_wsfe(&io___658);
    e_wsfe();
    il1 = str_ .il;
    if (ncy2 == 0) {
	il1 = str_ .il - 1;
    }
    i__1 = il1;
    for (k = 1; k <= i__1; ++k) {
	if ((i__3 = ell_ .kz[k - 1], (( i__3 ) >= 0 ? ( i__3 ) : -( i__3 )) ) == 12) {
	    s_wsfe(&io___660);
	    do_fio(&c__1, (char *)&k, (ftnlen)sizeof(integer));
	    do_fio(&c__1, linopc_ .bez + (k - 1 << 4), 16L);
	    do_fio(&c__1, (char *)& ell_ .kz[k - 1], (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)& ell_ .ed[k - 1], (ftnlen)sizeof(doublereal)
		    );
	    do_fio(&c__1, (char *)& ell_ .ek[k - 1], (ftnlen)sizeof(doublereal)
		    );
	    do_fio(&c__1, (char *)& syn_ .phasc[k - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& pla_ .xpl[k - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& pla_ .xrms[k - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& pla_ .zpl[k - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& pla_ .zrms[k - 1], (ftnlen)sizeof(
		    doublereal));
	    e_wsfe();
	    ell_ .kz[k - 1] = (i__3 = ell_ .kz[k - 1], (( i__3 ) >= 0 ? ( i__3 ) : -( i__3 )) );
	    syn_ .phasc[k - 1] *= kons_ .rad;
	} else {
	    s_wsfe(&io___661);
	    do_fio(&c__1, (char *)&k, (ftnlen)sizeof(integer));
	    do_fio(&c__1, linopc_ .bez + (k - 1 << 4), 16L);
	    do_fio(&c__1, (char *)& ell_ .kz[k - 1], (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)& ell_ .ed[k - 1], (ftnlen)sizeof(doublereal)
		    );
	    do_fio(&c__1, (char *)& ell_ .ek[k - 1], (ftnlen)sizeof(doublereal)
		    );
	    do_fio(&c__1, (char *)& ell_ .el[k - 1], (ftnlen)sizeof(doublereal)
		    );
	    do_fio(&c__1, (char *)& pla_ .xpl[k - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& pla_ .xrms[k - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& pla_ .zpl[k - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& pla_ .zrms[k - 1], (ftnlen)sizeof(
		    doublereal));
	    e_wsfe();
	}
 
    }
    s_wsfe(&io___662);
    e_wsfe();
    s_wsfe(&io___663);
    e_wsfe();
    s_wsfe(&io___664);
    do_fio(&c__1, (char *)& str_ .mper, (ftnlen)sizeof(integer));
    i__1 = str_ .mper;
    for (k = 1; k <= i__1; ++k) {
	do_fio(&c__1, (char *)& str_ .msym[k - 1], (ftnlen)sizeof(integer));
    }
    e_wsfe();
    s_wsfe(&io___665);
    do_fio(&c__1, (char *)& str_ .mblo, (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)& str_ .mbloz, (ftnlen)sizeof(integer));
    e_wsfe();
    s_wsfe(&io___666);
    e_wsfe();
    i__1 = str_ .mblo;
    for (l = 1; l <= i__1; ++l) {
	kk = str2_ .mel[l - 1];
	ll = kk / 6;
	if (ll != 0) {
	    i__3 = ll;
	    for (l1 = 1; l1 <= i__3; ++l1) {
		l2 = (l1 - 1) * 6 + 1;
		l3 = l2 + 5;
		if (l2 == 1) {
		    s_wsfe(&io___671);
		    do_fio(&c__1, (char *)&l, (ftnlen)sizeof(integer));
		    do_fio(&c__1, linopc_ .bezb + (l - 1 << 4), 16L);
		    do_fio(&c__1, (char *)&kk, (ftnlen)sizeof(integer));
		    for (k = 1; k <= 6; ++k) {
			do_fio(&c__1, beze + (l + k * 300 - 301 << 4), 16L);
		    }
		    e_wsfe();
		} else {
		    s_wsfe(&io___672);
		    i__4 = l3;
		    for (k = l2; k <= i__4; ++k) {
			do_fio(&c__1, beze + (l + k * 300 - 301 << 4), 16L);
		    }
		    e_wsfe();
		}
 
	    }
	    if (kk % 6 != 0) {
		l4 = ll * 6 + 1;
		s_wsfe(&io___674);
		i__3 = kk;
		for (k = l4; k <= i__3; ++k) {
		    do_fio(&c__1, beze + (l + k * 300 - 301 << 4), 16L);
		}
		e_wsfe();
	    }
	} else {
	    s_wsfe(&io___675);
	    do_fio(&c__1, (char *)&l, (ftnlen)sizeof(integer));
	    do_fio(&c__1, linopc_ .bezb + (l - 1 << 4), 16L);
	    do_fio(&c__1, (char *)&kk, (ftnlen)sizeof(integer));
	    i__3 = kk;
	    for (k = 1; k <= i__3; ++k) {
		do_fio(&c__1, beze + (l + k * 300 - 301 << 4), 16L);
	    }
	    e_wsfe();
	}
 
    }
    s_wsfe(&io___676);
    e_wsfe();
    mblozz = str_ .mbloz / 5 + 1;
    i__1 = mblozz;
    for (k = 1; k <= i__1; ++k) {
	k10 = (k - 1) * 5;
	if (str_ .mbloz - k10 == 0) {
	    goto L1480;
	}
	for (l = 1; l <= 5; ++l) {
	    if (k10 + l > str_ .mbloz) {
		s_copy(ic0 + (l - 1 << 4), " ", 16L, 1L);
	    }
	    if (k10 + l > str_ .mbloz) {
		goto L1470;
	    }
	    icc = str_ .ic[k10 + l - 1];
	    if (icc > 300) {
		goto L1460;
	    }
	    s_copy(ic0 + (l - 1 << 4), linopc_ .bezb + (icc - 1 << 4), 16L, 
		    16L);
	    goto L1470;
L1460:
	    s_copy(ic0 + (l - 1 << 4), bez0 + (icc - 301 << 4), 16L, 16L);
L1470:
	    ;
	}
	k11 = k10 + 1;
	s_wsfe(&io___681);
	do_fio(&c__1, (char *)&k11, (ftnlen)sizeof(integer));
	for (l = 1; l <= 5; ++l) {
	    do_fio(&c__1, ic0 + (l - 1 << 4), 16L);
	}
	e_wsfe();
L1480:
	;
    }
    s_wsfe(&io___682);
    e_wsfe();
 
    if (syn_ .idp == 0) {
	goto L1500;
    }
    if (beam_ .nbeam >= 1) {
	if (beam_ .partnum > 0.) {
	    s_wsfe(&io___683);
	    do_fio(&c__1, (char *)& syn_ .ncy, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)& anf_ .dp1, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& syn_ .dppoff, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& syn_ .tlen, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& syn_ .pma, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& beam_ .partnum, (ftnlen)sizeof(doublereal))
		    ;
	    do_fio(&c__1, (char *)& beam_ .ibeco, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)& beam_ .ibtyp, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)& beam_ .emitnx, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& beam_ .emitnz, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& syn_ .e0, (ftnlen)sizeof(doublereal));
	    d__1 = cor_ .dpscor * 1e3;
	    do_fio(&c__1, (char *)&d__1, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& cor_ .sigcor, (ftnlen)sizeof(doublereal));
	    e_wsfe();
	} else {
	    s_wsfe(&io___684);
	    do_fio(&c__1, (char *)& syn_ .ncy, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)& anf_ .dp1, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& syn_ .dppoff, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& syn_ .tlen, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& syn_ .pma, (ftnlen)sizeof(doublereal));
	    d__1 = (( beam_ .partnum ) >= 0 ? ( beam_ .partnum ) : -( beam_ .partnum )) ;
	    do_fio(&c__1, (char *)&d__1, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& beam_ .ibeco, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)& beam_ .ibtyp, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)& beam_ .emitnx, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& beam_ .emitnz, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& syn_ .e0, (ftnlen)sizeof(doublereal));
	    d__2 = cor_ .dpscor * 1e3;
	    do_fio(&c__1, (char *)&d__2, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& cor_ .sigcor, (ftnlen)sizeof(doublereal));
	    e_wsfe();
	}
    } else {
	s_wsfe(&io___685);
	do_fio(&c__1, (char *)& syn_ .ncy, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)& anf_ .dp1, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& syn_ .dppoff, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& syn_ .tlen, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& syn_ .pma, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& syn_ .e0, (ftnlen)sizeof(doublereal));
	d__1 = cor_ .dpscor * 1e3;
	do_fio(&c__1, (char *)&d__1, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& cor_ .sigcor, (ftnlen)sizeof(doublereal));
	e_wsfe();
    }
    if (ncy2 == 0) {
	s_wsfe(&io___686);
	do_fio(&c__1, (char *)&harm, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&u0, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&phag, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& syn_ .qs, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&alc, (ftnlen)sizeof(doublereal));
	e_wsfe();
    } else {
	s_wsle(&io___687);
	e_wsle();
    }
    s_wsfe(&io___688);
    e_wsfe();
L1500:
    s_wsfe(&io___689);
    e_wsfe();
    nfb = tra1_ .nde[0];
    nac = tra1_ .nde[1];
    nft = tra1_ .numl - tra1_ .nde[1];
    if (tra1_ .numl <= tra1_ .nde[1]) {
	nft = 0;
    }
    if (tra1_ .numl <= tra1_ .nde[1]) {
	nac = tra1_ .numl;
    }
    if (tra1_ .numl <= tra1_ .nde[0]) {
	nac = 0;
    }
    if (tra1_ .numl <= tra1_ .nde[0]) {
	nfb = tra1_ .numl;
    }
    s_wsfe(&io___693);
    do_fio(&c__1, (char *)& tra1_ .numl, (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)& tra1_ .numlr, (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)& tra1_ .nwr[3], (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)&nfb, (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)& tra1_ .nwr[0], (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)&nac, (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)& tra1_ .nwr[1], (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)&nft, (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)& tra1_ .nwr[2], (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)& str_ .kanf, (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)& (tra_._1) .amp[0], (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)& tra1_ .rat, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)& clo_ .itco, (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)& clo_ .dma, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)& clo_ .dmap, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)& clo_ .itqv, (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)& clo_ .dkq, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)& clo_ .dqq, (ftnlen)sizeof(doublereal));
    e_wsfe();
    s_wsfe(&io___694);
    do_fio(&c__1, (char *)& clo_ .itcro, (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)& clo_ .dsm0, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)& clo_ .dech, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)& clo_ .de0, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)& clo_ .ded, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)& clo_ .dsi, (ftnlen)sizeof(doublereal));
    e_wsfe();
    if (ripp_ .irip == 1) {
	s_wsfe(&io___695);
	e_wsfe();
	i__1 = ripp_ .irco;
	for (i__ = 1; i__ <= i__1; ++i__) {
	    j = ripp_ .nrel[i__ - 1];
 
	    s_wsfe(&io___696);
	    do_fio(&c__1, linopc_ .bez + (j - 1 << 4), 16L);
	    do_fio(&c__1, (char *)& ripp_ .ramp[j - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& ripp_ .rfre[j - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& ripp_ .rzph[j - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& ripp2_ .nrturn, (ftnlen)sizeof(integer));
	    e_wsfe();
	}
    }
    s_wsfe(&io___697);
    e_wsfe();
    s_wsfe(&io___698);
    e_wsfe();
    s_wsfe(&io___699);
    e_wsfe();
    goto L1540;
L1520:
    error_(&c__41);
L1530:
    error_(&c__42);
L1540:
    if ((rand0_ .mmac << 1) * tra1_ .imc * tra1_ .napx > 64) {
	error_(&c__54);
    }
 

 

    return 0;
 
 
}  

 
 
  int decoup_()
{
     
    static char fmt_10000[] = "(t5,\002---- ENTRY DECOUP ----\002)";
    static char fmt_10010[] = "(\002 \002,131(\002-\002))";
    static char fmt_10020[] = "(/10x,\002DECOUPLING ROUTINE  ITERATION #\002,i2//30x,\002BEFORE         AFTER     DECOUPLING\002//17x,\002   M(3,1)      \002,2g15.5/17x,\002   M(3,2)      \002,2g15.5/17x,\002   M(4,1)      \002,2g15.5/17x,\002   M(4,2)      \002,2g15.5//5x,\002SKEW QUDRUPOLE STRENGTHS\002)";
    static char fmt_10030[] = "(14x,a16,2x,g16.10,1x,g16.10/14x,a16,2x,g16.10,1x,g16.10/14x,a16,2x,g16.10,1x,g16.10/14x,a16,2x,g16.10,1x,g16.10)";
    static char fmt_10040[] = "(10x,\002Q-VARIATION\002/10x,\002Q-VALUE            THEORET.        AFTER     COMPENSATION\002/10x,\002HORIZONTAL     \002,2g15.7/10x,\002VERTICAL       \002,2g15.7/)";
    static char fmt_10060[] = "(10x,\002QUADRU.STRENGTH\002,2g15.8,\002   INDEX \002,i3/10x,\002               \002,2g15.8,\002         \002,i3)";
    static char fmt_10050[] = "(10x,\002CURRENT TUNE\002/10x,\002Q-VALUE\002/10x,\002HORIZONTAL     \002,g15.7/10x,\002VERTICAL       \002,g15.7/)";

     
    integer i__1;
    doublereal d__1;

     
    integer s_wsfe(), e_wsfe(), do_fio();

     
    static integer i__, j;
    static doublereal d1[6], aa[36]	 , bb[6];
    static integer no;
    static doublereal sn[6], ss[6], qw[2], dsm[6], sen[6], qwc[3], dpp;
    static integer ierr;
    extern   int loesd_(), error_(), betalf_(), phasad_(), 
	    combel_();

     
    static cilist io___711 = { 0, 6, 0, fmt_10000, 0 };
    static cilist io___715 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___716 = { 0, 6, 0, fmt_10020, 0 };
    static cilist io___717 = { 0, 6, 0, fmt_10030, 0 };
    static cilist io___718 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___719 = { 0, 6, 0, fmt_10040, 0 };
    static cilist io___720 = { 0, 6, 0, fmt_10060, 0 };
    static cilist io___721 = { 0, 6, 0, fmt_10060, 0 };
    static cilist io___722 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___723 = { 0, 6, 0, fmt_10050, 0 };


 

 

 

 

    for (i__ = 1; i__ <= 6; ++i__) {
	bb[i__ - 1] = 0.;
	dsm[i__ - 1] = 0.;
	sn[i__ - 1] = 0.;
	sen[i__ - 1] = 0.;
	ss[i__ - 1] = 0.;
	d1[i__ - 1] = 0.;
	for (j = 1; j <= 6; ++j) {
	    aa[i__ + j * 6 - 7] = 0.;
 
	}
    }
    for (i__ = 1; i__ <= 3; ++i__) {
	qwc[i__ - 1] = 0.;
 
    }
    dpp = 0.;
    s_wsfe(&io___711);
    e_wsfe();
    betalf_(&dpp, qw);
    phasad_(&dpp, qwc);
    sen[0] = beo_ .ta[2];
    sen[1] = beo_ .ta[8];
    sen[2] = beo_ .ta[3];
    sen[3] = beo_ .ta[9];
    if (skew_ .iskew == 1) {
	sen[4] = qwc[0];
	sen[5] = qwc[1];
    }
    for (i__ = 1; i__ <= 6; ++i__) {
	if (skew_ .iskew == 2 && i__ > 4) {
	    goto L30;
	}
	if (i__ <= 4) {
	    sn[i__ - 1] = ell_ .ed[skew_ .nskew[i__ - 1] - 1];
	    dsm[i__ - 1] = clo_ .dsm0;
	    bb[i__ - 1] = sen[i__ - 1];
	} else {
	    if ((d__1 = ell_ .el[skew_ .nskew[i__ - 1] - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 
		    1e-17) {
		sn[i__ - 1] = ell_ .ed[skew_ .nskew[i__ - 1] - 1];
	    } else {
		sn[i__ - 1] = ell_ .ek[skew_ .nskew[i__ - 1] - 1];
	    }
	    dsm[i__ - 1] = clo_ .dkq;
	    bb[i__ - 1] = sen[i__ - 1] - skew_ .qwsk[i__ - 5];
	}
	ss[i__ - 1] = sen[i__ - 1];
L30:
	;
    }
    i__1 = clo_ .itcro;
    for (no = 1; no <= i__1; ++no) {
	for (i__ = 1; i__ <= 6; ++i__) {
	    if (skew_ .iskew == 2 && i__ > 4) {
		goto L40;
	    }
	    if (i__ <= 4) {
		ell_ .ed[skew_ .nskew[i__ - 1] - 1] += dsm[i__ - 1];
	    } else {
		if ((d__1 = ell_ .el[skew_ .nskew[i__ - 1] - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <=
			 1e-17) {
		    ell_ .ed[skew_ .nskew[i__ - 1] - 1] += dsm[i__ - 1];
		} else {
		    ell_ .ek[skew_ .nskew[i__ - 1] - 1] += dsm[i__ - 1];
		}
	    }
	    if (ell_ .kp[skew_ .nskew[i__ - 1] - 1] == 5) {
		combel_(& skew_ .nskew[i__ - 1]);
	    }
	    betalf_(&dpp, qw);
	    phasad_(&dpp, qwc);
	    aa[i__ - 1] = (beo_ .ta[2] - ss[0]) / dsm[i__ - 1];
	    aa[i__ + 5] = (beo_ .ta[8] - ss[1]) / dsm[i__ - 1];
	    aa[i__ + 11] = (beo_ .ta[3] - ss[2]) / dsm[i__ - 1];
	    aa[i__ + 17] = (beo_ .ta[9] - ss[3]) / dsm[i__ - 1];
	    if (skew_ .iskew == 1) {
		aa[i__ + 23] = (qwc[0] - ss[4]) / dsm[i__ - 1];
		aa[i__ + 29] = (qwc[1] - ss[5]) / dsm[i__ - 1];
	    }
	    if (i__ <= 4) {
		ell_ .ed[skew_ .nskew[i__ - 1] - 1] -= dsm[i__ - 1];
	    } else {
		if ((d__1 = ell_ .el[skew_ .nskew[i__ - 1] - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <=
			 1e-17) {
		    ell_ .ed[skew_ .nskew[i__ - 1] - 1] -= dsm[i__ - 1];
		} else {
		    ell_ .ek[skew_ .nskew[i__ - 1] - 1] -= dsm[i__ - 1];
		}
	    }
	    if (ell_ .kp[skew_ .nskew[i__ - 1] - 1] == 5) {
		combel_(& skew_ .nskew[i__ - 1]);
	    }
L40:
	    ;
	}
	if (skew_ .iskew == 1) {
	    loesd_(aa, bb, &c__6, &c__6, &ierr);
	} else if (skew_ .iskew == 2) {
	    loesd_(aa, bb, &c__4, &c__4, &ierr);
	}
	if (ierr == 1) {
	    error_(&c__64);
	}
	for (i__ = 1; i__ <= 6; ++i__) {
	    if (skew_ .iskew == 2 && i__ > 4) {
		goto L50;
	    }
	    if (i__ <= 4) {
		ell_ .ed[skew_ .nskew[i__ - 1] - 1] -= bb[i__ - 1];
	    } else {
		if ((d__1 = ell_ .el[skew_ .nskew[i__ - 1] - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <=
			 1e-17) {
		    ell_ .ed[skew_ .nskew[i__ - 1] - 1] -= bb[i__ - 1];
		} else {
		    ell_ .ek[skew_ .nskew[i__ - 1] - 1] -= bb[i__ - 1];
		}
	    }
	    if (ell_ .kp[skew_ .nskew[i__ - 1] - 1] == 5) {
		combel_(& skew_ .nskew[i__ - 1]);
	    }
L50:
	    ;
	}
	betalf_(&dpp, qw);
	phasad_(&dpp, qwc);
	ss[0] = beo_ .ta[2];
	ss[1] = beo_ .ta[8];
	ss[2] = beo_ .ta[3];
	ss[3] = beo_ .ta[9];
	if (skew_ .iskew == 1) {
	    ss[4] = qwc[0];
	    ss[5] = qwc[1];
	}
	s_wsfe(&io___715);
	e_wsfe();
	s_wsfe(&io___716);
	do_fio(&c__1, (char *)&no, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)&sen[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&ss[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&sen[1], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&ss[1], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&sen[2], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&ss[2], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&sen[3], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&ss[3], (ftnlen)sizeof(doublereal));
	e_wsfe();
	s_wsfe(&io___717);
	do_fio(&c__1, linopc_ .bez + (skew_ .nskew[0] - 1 << 4), 16L);
	do_fio(&c__1, (char *)&sn[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& ell_ .ed[skew_ .nskew[0] - 1], (ftnlen)sizeof(
		doublereal));
	do_fio(&c__1, linopc_ .bez + (skew_ .nskew[1] - 1 << 4), 16L);
	do_fio(&c__1, (char *)&sn[1], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& ell_ .ed[skew_ .nskew[1] - 1], (ftnlen)sizeof(
		doublereal));
	do_fio(&c__1, linopc_ .bez + (skew_ .nskew[2] - 1 << 4), 16L);
	do_fio(&c__1, (char *)&sn[2], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& ell_ .ed[skew_ .nskew[2] - 1], (ftnlen)sizeof(
		doublereal));
	do_fio(&c__1, linopc_ .bez + (skew_ .nskew[3] - 1 << 4), 16L);
	do_fio(&c__1, (char *)&sn[3], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& ell_ .ed[skew_ .nskew[3] - 1], (ftnlen)sizeof(
		doublereal));
	e_wsfe();
	if (skew_ .iskew == 1) {
	    s_wsfe(&io___718);
	    e_wsfe();
	    s_wsfe(&io___719);
	    do_fio(&c__1, (char *)& skew_ .qwsk[0], (ftnlen)sizeof(doublereal))
		    ;
	    do_fio(&c__1, (char *)&qwc[0], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& skew_ .qwsk[1], (ftnlen)sizeof(doublereal))
		    ;
	    do_fio(&c__1, (char *)&qwc[1], (ftnlen)sizeof(doublereal));
	    e_wsfe();
	    if ((d__1 = ell_ .el[skew_ .nskew[4] - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
		s_wsfe(&io___720);
		do_fio(&c__1, (char *)&sn[4], (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& ell_ .ed[skew_ .nskew[4] - 1], (ftnlen)
			sizeof(doublereal));
		do_fio(&c__1, (char *)& skew_ .nskew[4], (ftnlen)sizeof(
			integer));
		do_fio(&c__1, (char *)&sn[5], (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& ell_ .ed[skew_ .nskew[5] - 1], (ftnlen)
			sizeof(doublereal));
		do_fio(&c__1, (char *)& skew_ .nskew[5], (ftnlen)sizeof(
			integer));
		e_wsfe();
	    } else {
		s_wsfe(&io___721);
		do_fio(&c__1, (char *)&sn[4], (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& ell_ .ek[skew_ .nskew[4] - 1], (ftnlen)
			sizeof(doublereal));
		do_fio(&c__1, (char *)& skew_ .nskew[4], (ftnlen)sizeof(
			integer));
		do_fio(&c__1, (char *)&sn[5], (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& ell_ .ek[skew_ .nskew[5] - 1], (ftnlen)
			sizeof(doublereal));
		do_fio(&c__1, (char *)& skew_ .nskew[5], (ftnlen)sizeof(
			integer));
		e_wsfe();
	    }
	} else if (skew_ .iskew == 2) {
	    s_wsfe(&io___722);
	    e_wsfe();
	    s_wsfe(&io___723);
	    do_fio(&c__1, (char *)&qwc[0], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&qwc[1], (ftnlen)sizeof(doublereal));
	    e_wsfe();
	}
	for (i__ = 1; i__ <= 6; ++i__) {
	    if (skew_ .iskew == 2 && i__ > 4) {
		goto L60;
	    }
	    if (i__ <= 4) {
		d1[i__ - 1] = (d__1 = ss[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
	    } else {
		d1[i__ - 1] = (d__1 = ss[i__ - 1] - skew_ .qwsk[i__ - 5], (( 
			d__1 ) >= 0 ? (  			d__1 ) : -(  			d__1 )) );
	    }
L60:
	    ;
	}
	for (i__ = 1; i__ <= 6; ++i__) {
	    if (skew_ .iskew == 2 && i__ > 4) {
		goto L70;
	    }
	    if (d1[i__ - 1] > clo_ .dsi) {
		goto L80;
	    }
L70:
	    ;
	}
	return 0;
L80:
	for (i__ = 1; i__ <= 6; ++i__) {
	    if (skew_ .iskew == 2 && i__ > 4) {
		goto L90;
	    }
	    if (i__ <= 4) {
		bb[i__ - 1] = ss[i__ - 1];
	    } else {
		bb[i__ - 1] = ss[i__ - 1] - skew_ .qwsk[i__ - 5];
	    }
L90:
	    ;
	}
 
    }
 

    return 0;
}  

 
 
  int detune_(iv, ekk, ep, beta, dtu, dtup, dfac)
integer *iv;
doublereal *ekk, *ep, *beta, *dtu, *dtup, *dfac;
{
     
    integer i__1, i__2;
    doublereal d__1, d__2;

     
    integer s_wsle(), e_wsle(), do_lio();
    double atan(), pow_di();

     
    static doublereal pi;
    static integer iv2, iv3, iv4, iv5, iv6;
    static doublereal vor, dtu1, dtu2, vtu1, vtu2;

     
    static cilist io___724 = { 0, 6, 0, 0, 0 };
    static cilist io___725 = { 0, 6, 0, 0, 0 };
    static cilist io___726 = { 0, 6, 0, 0, 0 };
    static cilist io___727 = { 0, 6, 0, 0, 0 };
    static cilist io___728 = { 0, 6, 0, 0, 0 };


 
 

     
    --dfac;
    dtup -= 3;
    dtu -= 3;
    --beta;
    --ep;

     
    if (*iv < 2) {
	s_wsle(&io___724);
	e_wsle();
	s_wsle(&io___725);
	do_lio(&c__9, &c__1, "       ***** ERROR IN DETUNE *****", 34L);
	e_wsle();
	s_wsle(&io___726);
	e_wsle();
	s_wsle(&io___727);
	do_lio(&c__9, &c__1, "       IV LESS THAN 2, NO DETUNING POSSIBLE", 
		43L);
	e_wsle();
	s_wsle(&io___728);
	e_wsle();
	return 0;
    }
    pi = atan(1.) * 4.;
    iv2 = *iv << 1;
    iv3 = *iv + 1;
    vtu1 = -(*ekk) * pow_di(&c_b461, &iv2) * dfac[iv2] / pi;
    dtu1 = 0.;
    dtu2 = 0.;
    i__1 = iv3;
    for (iv4 = 1; iv4 <= i__1; ++iv4) {
	iv5 = iv4 - 1;
	iv6 = *iv - iv5;
	vor = 1.;
	if (iv6 % 2 != 0) {
	    vor = -1.;
	}
 
	d__1 = dfac[iv5 + 1];
 
	d__2 = dfac[iv6 + 1];
	vtu2 = vor / (d__1 * d__1) / (d__2 * d__2) * pow_di(&beta[1], &iv5) * 
		pow_di(&beta[2], &iv6);
	if (iv5 != 0) {
	    i__2 = iv5 - 1;
	    dtu1 += vtu2 * iv5 * pow_di(&ep[1], &i__2) * pow_di(&ep[2], &iv6);
	    dtup[(*iv + (iv5 - 1 + iv6 * 5) * 5 << 1) + 1] += vtu2 * iv5 * 
		    vtu1;
	}
	if (iv6 != 0) {
	    i__2 = iv6 - 1;
	    dtu2 += vtu2 * iv6 * pow_di(&ep[1], &iv5) * pow_di(&ep[2], &i__2);
	    dtup[(*iv + (iv5 + (iv6 - 1) * 5) * 5 << 1) + 2] += vtu2 * iv6 * 
		    vtu1;
	}
 
    }
    dtu[(*iv << 1) + 1] += vtu1 * dtu1;
    dtu[(*iv << 1) + 2] += vtu1 * dtu2;
    return 0;
}  

  int dinv_(n, a, idin, r__, ifail)
integer *n;
doublereal *a;
integer *idin, *r__, *ifail;
{
     

    static char hname[6+1] = "DINV  ";
    static integer kprnt = 0;

     
    integer a_dim1, a_offset;
    doublereal d__1;

     
    static integer k;
    static doublereal s, t1, t2, t3, c11, c12, c13, c21, c22, c23, c31, c32, 
	    c33, det, temp;
    extern   int f010pr_(), dfact_();
    static integer jfail;
    extern   int dfinv_();

     
    --r__;
    a_dim1 = *idin;
    a_offset = a_dim1 + 1;
    a -= a_offset;

     

 

 

 

 

 

 

    if (*n < 1 || *n > *idin) {
	goto L7;
    }

 

    if (*n > 3) {
	goto L6;
    }
    *ifail = 0;
    if (*n < 3) {
	goto L4;
    }

 

 
    c11 = a[(a_dim1 << 1) + 2] * a[a_dim1 * 3 + 3] - a[a_dim1 * 3 + 2] * a[(
	    a_dim1 << 1) + 3];
    c12 = a[a_dim1 * 3 + 2] * a[a_dim1 + 3] - a[a_dim1 + 2] * a[a_dim1 * 3 + 
	    3];
    c13 = a[a_dim1 + 2] * a[(a_dim1 << 1) + 3] - a[(a_dim1 << 1) + 2] * a[
	    a_dim1 + 3];
    c21 = a[(a_dim1 << 1) + 3] * a[a_dim1 * 3 + 1] - a[a_dim1 * 3 + 3] * a[(
	    a_dim1 << 1) + 1];
    c22 = a[a_dim1 * 3 + 3] * a[a_dim1 + 1] - a[a_dim1 + 3] * a[a_dim1 * 3 + 
	    1];
    c23 = a[a_dim1 + 3] * a[(a_dim1 << 1) + 1] - a[(a_dim1 << 1) + 3] * a[
	    a_dim1 + 1];
    c31 = a[(a_dim1 << 1) + 1] * a[a_dim1 * 3 + 2] - a[a_dim1 * 3 + 1] * a[(
	    a_dim1 << 1) + 2];
    c32 = a[a_dim1 * 3 + 1] * a[a_dim1 + 2] - a[a_dim1 + 1] * a[a_dim1 * 3 + 
	    2];
    c33 = a[a_dim1 + 1] * a[(a_dim1 << 1) + 2] - a[(a_dim1 << 1) + 1] * a[
	    a_dim1 + 2];
    t1 = (d__1 = a[a_dim1 + 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
    t2 = (d__1 = a[a_dim1 + 2], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
    t3 = (d__1 = a[a_dim1 + 3], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );

 
    if (t1 >= t2) {
	goto L1;
    }
    if (t3 >= t2) {
	goto L2;
    }
 
    temp = a[a_dim1 + 2];
    det = c13 * c32 - c12 * c33;
    goto L3;
L1:
    if (t3 >= t1) {
	goto L2;
    }
 
    temp = a[a_dim1 + 1];
    det = c22 * c33 - c23 * c32;
    goto L3;
 
L2:
    temp = a[a_dim1 + 3];
    det = c23 * c12 - c22 * c13;

 
L3:
    if (det == 0.) {
	goto L8;
    }
    s = temp / det;
    a[a_dim1 + 1] = s * c11;
    a[(a_dim1 << 1) + 1] = s * c21;
    a[a_dim1 * 3 + 1] = s * c31;
    a[a_dim1 + 2] = s * c12;
    a[(a_dim1 << 1) + 2] = s * c22;
    a[a_dim1 * 3 + 2] = s * c32;
    a[a_dim1 + 3] = s * c13;
    a[(a_dim1 << 1) + 3] = s * c23;
    a[a_dim1 * 3 + 3] = s * c33;
    return 0;

L4:
    if (*n < 2) {
	goto L5;
    }

 

    det = a[a_dim1 + 1] * a[(a_dim1 << 1) + 2] - a[(a_dim1 << 1) + 1] * a[
	    a_dim1 + 2];
    if (det == 0.) {
	goto L8;
    }
    s = 1. / det;
    c11 = s * a[(a_dim1 << 1) + 2];
    a[(a_dim1 << 1) + 1] = -s * a[(a_dim1 << 1) + 1];
    a[a_dim1 + 2] = -s * a[a_dim1 + 2];
    a[(a_dim1 << 1) + 2] = s * a[a_dim1 + 1];
    a[a_dim1 + 1] = c11;
    return 0;

 

L5:
    if (a[a_dim1 + 1] == 0.) {
	goto L8;
    }
    a[a_dim1 + 1] = 1. / a[a_dim1 + 1];
    return 0;

 

L6:
    dfact_(n, &a[a_offset], idin, &r__[1], ifail, &det, &jfail);
    if (*ifail != 0) {
	return 0;
    }
    dfinv_(n, &a[a_offset], idin, &r__[1]);
    return 0;

 

L7:
    *ifail = 1;
    f010pr_(hname, n, idin, &k, &kprnt, 6L);
    return 0;

L8:
    *ifail = -1;
    return 0;

}  

  int dfact_(n, a, idin, ir, ifail, det, jfail)
integer *n;
doublereal *a;
integer *idin, *ir, *ifail;
doublereal *det;
integer *jfail;
{
     

    static doublereal g1 = 1e-37;
    static doublereal g2 = 1e37;
    static char hname[6+1] = "DFACT ";
    static doublereal zero = 0.;
    static doublereal one = 1.;
    static integer normal = 0;
    static integer imposs = -1;
    static integer jrange = 0;
    static integer jover = 1;
    static integer junder = -1;

     
    integer a_dim1, a_offset, i__1, i__2, i__3;
    doublereal d__1;

     
    static integer i__, j, k, l;
    static doublereal p, q, t, s11, s12, tf;
    static integer jm1, jp1, nxch;
    extern   int tmprnt_();

     
    a_dim1 = *idin;
    a_offset = a_dim1 + 1;
    a -= a_offset;
    --ir;

     
    if (*idin >= *n && *n > 0) {
	goto L110;
    }
    tmprnt_(hname, n, idin, &c__0, 6L);
    return 0;
L110:
    *ifail = normal;
    *jfail = jrange;
    nxch = 0;
    *det = one;
    i__1 = *n;
    for (j = 1; j <= i__1; ++j) {
 
	k = j;
	p = (d__1 = a[j + j * a_dim1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
	if (j == *n) {
	    goto L122;
	}
	jp1 = j + 1;
	i__2 = *n;
	for (i__ = jp1; i__ <= i__2; ++i__) {
	    q = (d__1 = a[i__ + j * a_dim1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
	    if (q <= p) {
		goto L121;
	    }
	    k = i__;
	    p = q;
L121:
	    ;
	}
	if (k != j) {
	    goto L123;
	}
L122:
	if (p > (float)0.) {
	    goto L130;
	}
	*det = zero;
	*ifail = imposs;
	*jfail = jrange;
	return 0;
L123:
	i__2 = *n;
	for (l = 1; l <= i__2; ++l) {
	    tf = a[j + l * a_dim1];
	    a[j + l * a_dim1] = a[k + l * a_dim1];
	    a[k + l * a_dim1] = tf;
 
	}
	++nxch;
	ir[nxch] = (j << 12) + k;
L130:
	*det *= a[j + j * a_dim1];
	a[j + j * a_dim1] = one / a[j + j * a_dim1];
	t = (( *det ) >= 0 ? ( *det ) : -( *det )) ;
	if (t < g1) {
	    goto L132;
	}
	if (t > g2) {
	    goto L133;
	}
L131:
	if (j == *n) {
	    goto L144;
	}
	goto L140;
L132:
	*det = zero;
	if (*jfail == jrange) {
	    *jfail = junder;
	}
	goto L131;
L133:
	*det = one;
	if (*jfail == jrange) {
	    *jfail = jover;
	}
	goto L131;
L140:
	jm1 = j - 1;
	jp1 = j + 1;
	i__2 = *n;
	for (k = jp1; k <= i__2; ++k) {
	    s11 = -a[j + k * a_dim1];
	    s12 = -a[k + (j + 1) * a_dim1];
	    if (j == 1) {
		goto L142;
	    }
	    i__3 = jm1;
	    for (i__ = 1; i__ <= i__3; ++i__) {
		s11 = a[i__ + k * a_dim1] * a[j + i__ * a_dim1] + s11;
		s12 = a[i__ + (j + 1) * a_dim1] * a[k + i__ * a_dim1] + s12;
 
	    }
L142:
	    a[j + k * a_dim1] = -s11 * a[j + j * a_dim1];
	    a[k + (j + 1) * a_dim1] = -(a[j + (j + 1) * a_dim1] * a[k + j * 
		    a_dim1] + s12);
 
	}
L144:
	;
    }
 
    if (nxch % 2 != 0) {
	*det = -(*det);
    }
    if (*jfail != jrange) {
	*det = zero;
    }
    ir[*n] = nxch;
    return 0;
}  

  int dfinv_(n, a, idin, ir)
integer *n;
doublereal *a;
integer *idin, *ir;
{
     

    static char hname[6+1] = "DFINV ";
    static doublereal zero = 0.;

     
    integer a_dim1, a_offset, i__1, i__2, i__3;

     
    static integer i__, j, k, m, ij;
    static doublereal s31, s32, s33, s34, ti;
    static integer im2, nm1, nmi, nxch;
    extern   int tmprnt_();

     
    a_dim1 = *idin;
    a_offset = a_dim1 + 1;
    a -= a_offset;
    --ir;

     
    if (*idin >= *n && *n > 0) {
	goto L310;
    }
    tmprnt_(hname, n, idin, &c__0, 6L);
    return 0;
L310:
    if (*n == 1) {
	return 0;
    }
    a[a_dim1 + 2] = -a[(a_dim1 << 1) + 2] * (a[a_dim1 + 1] * a[a_dim1 + 2] + 
	    zero);
    a[(a_dim1 << 1) + 1] = -a[(a_dim1 << 1) + 1];
    if (*n == 2) {
	goto L330;
    }
    i__1 = *n;
    for (i__ = 3; i__ <= i__1; ++i__) {
	im2 = i__ - 2;
	i__2 = im2;
	for (j = 1; j <= i__2; ++j) {
	    s31 = zero;
	    s32 = a[j + i__ * a_dim1];
	    i__3 = im2;
	    for (k = j; k <= i__3; ++k) {
		s31 = a[k + j * a_dim1] * a[i__ + k * a_dim1] + s31;
		s32 = a[j + (k + 1) * a_dim1] * a[k + 1 + i__ * a_dim1] + s32;
 
	    }
	    a[i__ + j * a_dim1] = -a[i__ + i__ * a_dim1] * (a[i__ - 1 + j * 
		    a_dim1] * a[i__ + (i__ - 1) * a_dim1] + s31);
	    a[j + i__ * a_dim1] = -s32;
 
	}
	a[i__ + (i__ - 1) * a_dim1] = -a[i__ + i__ * a_dim1] * (a[i__ - 1 + (
		i__ - 1) * a_dim1] * a[i__ + (i__ - 1) * a_dim1] + zero);
	a[i__ - 1 + i__ * a_dim1] = -a[i__ - 1 + i__ * a_dim1];
 
    }
L330:
    nm1 = *n - 1;
    i__1 = nm1;
    for (i__ = 1; i__ <= i__1; ++i__) {
	nmi = *n - i__;
	i__2 = i__;
	for (j = 1; j <= i__2; ++j) {
	    s33 = a[i__ + j * a_dim1];
	    i__3 = nmi;
	    for (k = 1; k <= i__3; ++k) {
		s33 = a[i__ + k + j * a_dim1] * a[i__ + (i__ + k) * a_dim1] + 
			s33;
 
	    }
	    a[i__ + j * a_dim1] = s33;
 
	}
	i__2 = nmi;
	for (j = 1; j <= i__2; ++j) {
	    s34 = zero;
	    i__3 = nmi;
	    for (k = j; k <= i__3; ++k) {
		s34 = a[i__ + k + (i__ + j) * a_dim1] * a[i__ + (i__ + k) * 
			a_dim1] + s34;
 
	    }
	    a[i__ + (i__ + j) * a_dim1] = s34;
 
	}
 
    }
    nxch = ir[*n];
    if (nxch == 0) {
	return 0;
    }
    i__1 = nxch;
    for (m = 1; m <= i__1; ++m) {
	k = nxch - m + 1;
	ij = ir[k];
	i__ = ij / 4096;
	j = ij % 4096;
	i__2 = *n;
	for (k = 1; k <= i__2; ++k) {
	    ti = a[k + i__ * a_dim1];
	    a[k + i__ * a_dim1] = a[k + j * a_dim1];
	    a[k + j * a_dim1] = ti;
 
	}
 
    }
    return 0;
}  

  int f010pr_(name__, n, idin, k, kprnt, name_len)
char *name__;
integer *n, *idin, *k, *kprnt;
ftnlen name_len;
{
     
    static char fmt_2000[] = "(7x,\002SUBROUTINE \002,a6,\002 ... PARAMETER\002,\002 ERROR (N.LT.1 OR N.GT.IDIN).\002,6x,\002N =\002,i4,6x,\002IDIN =\002,i4,\002.\002)";
    static char fmt_2001[] = "(7x,\002SUBROUTINE \002,a6,\002  ... PARAMETER\002,\002 ERROR (N.LT.1 OR N.GT.IDIN OR K.LT.1).\002,6x,\002N =\002,i4,6x,\002IDIN =\002,i4,6x,\002K =\002,i4,\002.\002)";

     
    integer s_wsfe(), do_fio(), e_wsfe();

     
    extern   int abend_();
    static logical mflag, rflag;
    static integer lgfile;
    extern   int kermtr_();

     
    static cilist io___801 = { 0, 6, 0, fmt_2000, 0 };
    static cilist io___802 = { 0, 6, 0, fmt_2001, 0 };
    static cilist io___803 = { 0, 0, 0, fmt_2000, 0 };
    static cilist io___804 = { 0, 0, 0, fmt_2001, 0 };



 


 
 

 

 
 

 

 


 
    kermtr_("F010.1", &lgfile, &mflag, &rflag, 6L);
    if (mflag) {
	if (lgfile == 0) {
	    if (*kprnt == 0) {
		s_wsfe(&io___801);
		do_fio(&c__1, name__, name_len);
		do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)&(*idin), (ftnlen)sizeof(integer));
		e_wsfe();
	    }
	    if (*kprnt != 0) {
		s_wsfe(&io___802);
		do_fio(&c__1, name__, name_len);
		do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)&(*idin), (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)&(*k), (ftnlen)sizeof(integer));
		e_wsfe();
	    }
	} else {
	    if (*kprnt == 0) {
		io___803.ciunit = lgfile;
		s_wsfe(&io___803);
		do_fio(&c__1, name__, name_len);
		do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)&(*idin), (ftnlen)sizeof(integer));
		e_wsfe();
	    }
	    if (*kprnt != 0) {
		io___804.ciunit = lgfile;
		s_wsfe(&io___804);
		do_fio(&c__1, name__, name_len);
		do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)&(*idin), (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)&(*k), (ftnlen)sizeof(integer));
		e_wsfe();
	    }
	}
    }
    if (! rflag) {
	abend_();
    }
    return 0;

}  

  int tmprnt_(hname, n, idin, k, hname_len)
char *hname;
integer *n, *idin, *k;
ftnlen hname_len;
{
     
    static char fmt_1002[] = "(7x,\002 PARAMETER ERROR IN SUBROUTINE \002,a6,\002 ... (N.LT.1 OR IDIN.LT.N OR K.LT.1).\002,5x,\002N =\002,i4,5x,\002IDIN =\002,i4,5x,\002K =\002,i4,\002.\002)";

     
    integer s_wsfe(), do_fio(), e_wsfe();

     
    extern   int abend_();
    static logical mflag, rflag;
    static integer lgfile;
    extern   int kermtr_();

     
    static cilist io___808 = { 0, 6, 0, fmt_1002, 0 };
    static cilist io___809 = { 0, 0, 0, fmt_1002, 0 };


    kermtr_("F11/12", &lgfile, &mflag, &rflag, 6L);
    if (mflag) {
	if (lgfile == 0) {
	    s_wsfe(&io___808);
	    do_fio(&c__1, hname, hname_len);
	    do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&(*idin), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&(*k), (ftnlen)sizeof(integer));
	    e_wsfe();
	} else {
	    io___809.ciunit = lgfile;
	    s_wsfe(&io___809);
	    do_fio(&c__1, hname, hname_len);
	    do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&(*idin), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&(*k), (ftnlen)sizeof(integer));
	    e_wsfe();
	}
    }
    if (! rflag) {
	abend_();
    }
    return 0;
}  

  int kerset_0_(n__, ercode, lgfile, limitm, limitr, log__, 
	mflag, rflag, ercode_len)
int n__;
char *ercode;
integer *lgfile, *limitm, *limitr, *log__;
logical *mflag, *rflag;
ftnlen ercode_len;
{
     

    static integer logf = 0;
    static char code[6*28+1] = "C204.1C204.2C204.3C205.1C205.2C205.3C305.1C308.1C312.1C313.1C336.1C337.1C341.1D103.1D106.1D209.1D509.1E100.1E104.1E105.1E208.1E208.2F010.1F011.1F012.1F406.1G100.1G100.2";
    static integer kntm[28] = { 100,100,100,100,100,100,100,100,100,100,100,
	    100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,
	    100 };
    static integer kntr[28] = { 100,100,100,100,100,100,100,100,100,100,100,
	    100,100,100,100,100,100,100,100,100,100,100,0,0,0,0,100,100 };

     
    static char fmt_1000[] = "(\002 KERNLIB LIBRARY ERROR. \002/\002 ERROR CODE \002,a6,\002 NOT RECOGNIZED BY KERMTR\002,\002 ERROR MONITOR. RUN ABORTED.\002)";
    static char fmt_1001[] = "(/\002 ***** RUN TERMINATED BY CERN LIBRARY ERROR \002,\002CONDITION \002,a6)";
    static char fmt_1002[] = "(/\002 ***** CERN LIBRARY ERROR CONDITION \002,a6)";

     
    integer s_cmp(), s_wsfe(), do_fio(), e_wsfe();

     
    static integer i__;
    extern   int abend_();
    static logical erflag;

     
    static cilist io___816 = { 0, 6, 0, fmt_1000, 0 };
    static cilist io___817 = { 0, 6, 0, fmt_1001, 0 };
    static cilist io___818 = { 0, 0, 0, fmt_1001, 0 };
    static cilist io___819 = { 0, 6, 0, fmt_1002, 0 };
    static cilist io___820 = { 0, 0, 0, fmt_1002, 0 };


    switch(n__) {
	case 1: goto L_kermtr;
	}

    logf = *lgfile;
    erflag = (0) ;
    for (i__ = 1; i__ <= 28; ++i__) {
	if (s_cmp(code + (i__ - 1) * 6, ercode, 6L, 6L) != 0) {
	    goto L14;
	}
	kntm[i__ - 1] = *limitm;
	kntr[i__ - 1] = *limitr;
	erflag = (1) ;
L14:
	;
    }
    if (! erflag) {
	for (i__ = 1; i__ <= 28; ++i__) {
	    kntm[i__ - 1] = *limitm;
 
	    kntr[i__ - 1] = *limitr;
	}
    }
    return 0;

L_kermtr:
    *log__ = logf;
    for (i__ = 1; i__ <= 28; ++i__) {
	if (s_cmp(ercode, code + (i__ - 1) * 6, 6L, 6L) == 0) {
	    goto L21;
	}
 
    }
    s_wsfe(&io___816);
    do_fio(&c__1, ercode, 6L);
    e_wsfe();
    abend_();
    return 0;
L21:
    *rflag = kntr[i__ - 1] >= 1;
    if (*rflag && kntr[i__ - 1] < 100) {
	--kntr[i__ - 1];
    }
    *mflag = kntm[i__ - 1] >= 1;
    if (*mflag && kntm[i__ - 1] < 100) {
	--kntm[i__ - 1];
    }
    if (! (*rflag)) {
	if (logf < 1) {
	    s_wsfe(&io___817);
	    do_fio(&c__1, code + (i__ - 1) * 6, 6L);
	    e_wsfe();
	} else {
	    io___818.ciunit = logf;
	    s_wsfe(&io___818);
	    do_fio(&c__1, code + (i__ - 1) * 6, 6L);
	    e_wsfe();
	}
    }
    if (*mflag && *rflag) {
	if (logf < 1) {
	    s_wsfe(&io___819);
	    do_fio(&c__1, code + (i__ - 1) * 6, 6L);
	    e_wsfe();
	} else {
	    io___820.ciunit = logf;
	    s_wsfe(&io___820);
	    do_fio(&c__1, code + (i__ - 1) * 6, 6L);
	    e_wsfe();
	}
    }
    return 0;
}  

  int kerset_(ercode, lgfile, limitm, limitr, ercode_len)
char *ercode;
integer *lgfile, *limitm, *limitr;
ftnlen ercode_len;
{
    return kerset_0_(0, ercode, lgfile, limitm, limitr, (integer *)0, (
	    logical *)0, (logical *)0, ercode_len);
    }

  int kermtr_(ercode, log__, mflag, rflag, ercode_len)
char *ercode;
integer *log__;
logical *mflag, *rflag;
ftnlen ercode_len;
{
    return kerset_0_(1, ercode, (integer *)0, (integer *)0, (integer *)0, 
	    log__, mflag, rflag, ercode_len);
    }

 
 
  int dist1_()
{
     
    integer i__1;

     
    extern   int distance_();
    static integer ia, ie, ib2, ib3;
    static doublereal dam1;

 


 
 

 
 

    i__1 = tra1_ .napx;
    for (ia = 1; ia <= i__1; ia += 2) {
	if (! main1_ .pstop[main1_ .nlostp[ia - 1] - 1] && ! main1_ .pstop[
		main1_ .nlostp[ia - 1]] && main1_ .nlostp[ia - 1] % 2 != 0) {
	    ie = ia + 1;
	    main1_ .dam[ia - 1] = 0.;
	    main1_ .dam[ie - 1] = 0.;
	    main3_ .xau[0] = main1_ .xv[(ia << 1) - 2];
	    main3_ .xau[2] = main1_ .yv[(ia << 1) - 2];
	    main3_ .xau[4] = main1_ .xv[(ia << 1) - 1];
	    main3_ .xau[6] = main1_ .yv[(ia << 1) - 1];
	    main3_ .xau[8] = main1_ .sigmv[ia - 1];
	    main3_ .xau[10] = main1_ .dpsv[ia - 1];
	    main3_ .xau[1] = main1_ .xv[(ie << 1) - 2];
	    main3_ .xau[3] = main1_ .yv[(ie << 1) - 2];
	    main3_ .xau[5] = main1_ .xv[(ie << 1) - 1];
	    main3_ .xau[7] = main1_ .yv[(ie << 1) - 1];
	    main3_ .xau[9] = main1_ .sigmv[ie - 1];
	    main3_ .xau[11] = main1_ .dpsv[ie - 1];
	    main3_ .cloau[0] = main3_ .clo6v[ia * 3 - 3];
	    main3_ .cloau[1] = main3_ .clop6v[ia * 3 - 3];
	    main3_ .cloau[2] = main3_ .clo6v[ia * 3 - 2];
	    main3_ .cloau[3] = main3_ .clop6v[ia * 3 - 2];
	    main3_ .cloau[4] = main3_ .clo6v[ia * 3 - 1];
	    main3_ .cloau[5] = main3_ .clop6v[ia * 3 - 1];
	    main3_ .di0au[0] = main3_ .di0xs[ia - 1];
	    main3_ .di0au[1] = main3_ .dip0xs[ia - 1];
	    main3_ .di0au[2] = main3_ .di0zs[ia - 1];
	    main3_ .di0au[3] = main3_ .dip0zs[ia - 1];
	    for (ib2 = 1; ib2 <= 6; ++ib2) {
		for (ib3 = 1; ib3 <= 6; ++ib3) {
		    main3_ .tau[ib2 + ib3 * 6 - 7] = main3_ .tasau[ia + (ib2 
			    + ib3 * 6 << 6) - 449];
 
		}
	    }
	    distance_(main3_ .xau, main3_ .cloau, main3_ .di0au, main3_ .tau, 
		    &dam1);
	    main1_ .dam[ia - 1] = dam1;
	    main1_ .dam[ie - 1] = dam1;
	}
 
    }
    return 0;
}  

 
  int distance_(x, clo, di0, t, dam)
doublereal *x, *clo, *di0, *t, *dam;
{
     
    double atan(), atan2(), sqrt();

     
    static integer i__, j;
    static doublereal x1[12]	 ;
    static integer ii;
    static doublereal pi;
    static integer iq, jq;
    static doublereal cx, sx, phi[3];

 

 
 

 

     
    t -= 7;
    --di0;
    --clo;
    x -= 3;

     
    pi = atan(1.) * 4.;
    if (cor_ .icode >= 4 && cor_ .its6d == 0) {
	for (i__ = 1; i__ <= 2; ++i__) {
	    for (j = 1; j <= 4; ++j) {
		x[i__ + (j << 1)] -= di0[j] * x[i__ + 12];
 
	    }
	}
    }
    for (i__ = 1; i__ <= 2; ++i__) {
	for (j = 1; j <= 6; ++j) {
	    x[i__ + (j << 1)] -= clo[j];
 
	}
	if (cor_ .its6d == 1) {
	    x[i__ + 4] /= x[i__ + 12] + 1. + clo[6];
	    x[i__ + 8] /= x[i__ + 12] + 1. + clo[6];
	}
	for (iq = 1; iq <= 6; ++iq) {
	    x1[i__ + (iq << 1) - 3] = 0.;
	    for (jq = 1; jq <= 6; ++jq) {
		x1[i__ + (iq << 1) - 3] += t[jq + iq * 6] * x[i__ + (jq << 1)]
			;
 
	    }
 
	}
	for (j = 1; j <= 6; ++j) {
	    x[i__ + (j << 1)] = x1[i__ + (j << 1) - 3];
 
	}
 
    }
    for (i__ = 1; i__ <= 2; ++i__) {
	x[i__ + 10] *= cor_ .sigcor;
	x[i__ + 12] *= cor_ .dpscor;
 
    }
    for (i__ = 1; i__ <= 3; ++i__) {
	ii = i__ << 1;
	sx = x[(ii - 1 << 1) + 2] * x[(ii << 1) + 1] - x[(ii - 1 << 1) + 1] * 
		x[(ii << 1) + 2];
	cx = x[(ii - 1 << 1) + 1] * x[(ii - 1 << 1) + 2] + x[(ii << 1) + 1] * 
		x[(ii << 1) + 2];
	if ((( sx ) >= 0 ? ( sx ) : -( sx ))  > 1e-17 || (( cx ) >= 0 ? ( cx ) : -( cx ))  > 1e-17) {
	    phi[i__ - 1] = atan2(sx, cx);
	} else {
	    phi[i__ - 1] = 0.;
	}
 
    }
    *dam = sqrt((phi[0] * phi[0] + phi[1] * phi[1] + phi[2] * phi[2]) / 
	    cor_ .idam) / pi;
 

    return 0;
}  

doublereal dlie6_(j)
integer *j;
{
     
    doublereal ret_val;

     
    static integer i__;

     
    --j;

     
    ret_val = 0.;
    for (i__ = 1; i__ <= 3; ++i__) {
 
	ret_val = j[(i__ << 1) - 1] + j[i__ * 2] + ret_val;
    }
    ret_val += 1.;
    ret_val = 1. / ret_val;
    return ret_val;
}  

 

 
  int eig66_(fm, reval, aieval, revec, aievec)
doublereal *fm, *reval, *aieval, *revec, *aievec;
{
     
    doublereal d__1, d__2, d__3;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer i__, i1;
    static doublereal aa[36]	 ;
    static integer nn;
    static doublereal vv[36]	 ;
    static integer ihi, jet, ilo;
    extern   int ety_();
    static doublereal ort[6];
    extern   int ety2_();
    static integer mdim, info;
    extern   int etyt_();

     
    static cilist io___847 = { 0, 6, 0, 0, 0 };
    static cilist io___849 = { 0, 6, 0, 0, 0 };


 
 
 
 
 
 
 
 
 

 
     
    aievec -= 7;
    revec -= 7;
    --aieval;
    --reval;
    fm -= 7;

     
    for (i__ = 1; i__ <= 6; ++i__) {
	for (i1 = 1; i1 <= 6; ++i1) {
	    aa[i1 + i__ * 6 - 7] = fm[i1 + i__ * 6];
 
	}
    }
    ilo = 1;
    ihi = 6;
    mdim = 6;
    nn = 6;
 
 
    ety_(&mdim, &nn, &ilo, &ihi, aa, ort);
    etyt_(&mdim, &nn, &ilo, &ihi, aa, ort, vv);
    ety2_(&mdim, &nn, &ilo, &ihi, aa, &reval[1], &aieval[1], vv, &info);
    if (info != 0) {
	s_wsle(&io___847);
	do_lio(&c__9, &c__1, "  ERROR IN EIG6", 15L);
	e_wsle();
	return 0;
    }
 
    for (i__ = 1; i__ <= 3; ++i__) {
	for (jet = 1; jet <= 6; ++jet) {
	    revec[jet + ((i__ << 1) - 1) * 6] = vv[jet + ((i__ << 1) - 1) * 6 
		    - 7];
	    revec[jet + i__ * 12] = vv[jet + ((i__ << 1) - 1) * 6 - 7];
	    aievec[jet + ((i__ << 1) - 1) * 6] = vv[jet + i__ * 12 - 7];
 
	    aievec[jet + i__ * 12] = -vv[jet + i__ * 12 - 7];
	}
 
    }
    for (i__ = 1; i__ <= 6; ++i__) {
 
	d__2 = reval[i__];
 
	d__3 = aieval[i__];
	if ((d__1 = d__2 * d__2 + d__3 * d__3 - 1., (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-10) {
	    s_wsle(&io___849);
	    do_lio(&c__9, &c__1, " EIG6: EIGENVALUES OFF THE UNIT CIRCLE!", 
		    39L);
	    e_wsle();
	    return 0;
	}
 
    }
    return 0;
}  

 
 
  int envada_(ix)
integer *ix;
{
     
    integer i__1, i__2;
    doublereal d__1;

     
    static integer g, i__, l, hc, si, co, gl, hi, fi, hp, hm, hs, wf, ih, ip, 
	    hi1, as3, as4, as6, sm1, sm2, sm3, sm4, sm5, sm6, kz1, fokq, wfhi,
	     dpd, dpsq, fok, rho, fok1, sm12, sm23, siq, rhoc, aek, fokc, 
	    afok, rhoi, wfa;
    extern   int dakey_(), daall_();
    static integer idaa;
    extern   int dacad_(), dacop_(), dafun_(), dacon_(), 
	    dacmu_(), damul_(), dacdi_(), dasuc_(), dadic_(), dadiv_(), 
	    daadd_(), dasub_();
    extern doublereal dare_();
    static integer ien;
    extern   int dapri6_(), dadal_();
    static doublereal result;

 

 
 
 
 

 

 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
    if ((dial_ .idalloc == 1 || dial_ .idalloc == 3) && *ix != tra1_ .numl * 
	    syn_ .ncy) {
	dakey_("FOX V2.1", 8L);
	daall_(&fokq, &c__1, "FOKQ      ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&wfhi, &c__1, "WFHI      ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&dpd, &c__1, "DPD       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&dpsq, &c__1, "DPSQ      ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&fok, &c__1, "FOK       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&rho, &c__1, "RHO       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&fok1, &c__1, "FOK1      ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&sm1, &c__1, "SM1       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&sm2, &c__1, "SM2       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&sm3, &c__1, "SM3       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&sm4, &c__1, "SM4       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&sm5, &c__1, "SM5       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&sm6, &c__1, "SM6       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&sm12, &c__1, "SM12      ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&sm23, &c__1, "SM23      ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&as3, &c__1, "AS3       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&as4, &c__1, "AS4       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&as6, &c__1, "AS6       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&si, &c__1, "SI        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&co, &c__1, "CO        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&g, &c__1, "G         ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&gl, &c__1, "GL        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&siq, &c__1, "SIQ       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&rhoc, &c__1, "RHOC      ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&hi, &c__1, "HI        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&fi, &c__1, "FI        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&aek, &c__1, "AEK       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&hi1, &c__1, "HI1       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&hp, &c__1, "HP        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&hm, &c__1, "HM        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&hc, &c__1, "HC        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&hs, &c__1, "HS        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&fokc, &c__1, "FOKC      ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&wf, &c__1, "WF        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&afok, &c__1, "AFOK      ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&rhoi, &c__1, "RHOI      ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&wfa, &c__1, "WFA       ", & dial_ .nord, & dial_ .nvar, 10L);
    }
    idaa = dascr_ .idao;
 
 

 

    dacad_(& daele_ .dpda, &c_b2366, & dascr_ .iscrda[idaa]);
    dacop_(& dascr_ .iscrda[idaa], &dpd);
 

    dafun_("SQRT  ", &dpd, & dascr_ .iscrda[idaa], 6L);
    dacop_(& dascr_ .iscrda[idaa], &dpsq);
    i__1 = str_ .il;
    for (i__ = 1; i__ <= i__1; ++i__) {
	for (ih = 1; ih <= 2; ++ih) {
	    for (ip = 1; ip <= 6; ++ip) {
 

		dascr_ .rscrri[99] = 0.;
		dacon_(& daele_ .alda[ih + (ip << 1) - 3], & dascr_ .rscrri[99])
			;
 

		dascr_ .rscrri[99] = 0.;
		dacon_(& daele_ .asda[ih + (ip << 1) - 3], & dascr_ .rscrri[99])
			;
 
	    }
	}
	if ((d__1 = ell_ .el[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    goto L190;
	}
	kz1 = ell_ .kz[i__ - 1] + 1;
	switch ((int)kz1) {
	    case 1:  goto L20;
	    case 2:  goto L40;
	    case 3:  goto L100;
	    case 4:  goto L60;
	    case 5:  goto L80;
	    case 6:  goto L90;
	    case 7:  goto L130;
	    case 8:  goto L170;
	    case 9:  goto L180;
	}
 

 
 

L20:
	for (l = 1; l <= 2; ++l) {
 

	    dascr_ .rscrri[99] = 1.;
	    dacon_(& daele_ .alda[l - 1], & dascr_ .rscrri[99]);
 

	    dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	    dascr_ .rscrri[99] = dascr_ .rscrri[idaa];
	    dacon_(& daele_ .alda[l + 1], & dascr_ .rscrri[99]);
 

	    dascr_ .rscrri[99] = 0.;
	    dacon_(& daele_ .alda[l + 3], & dascr_ .rscrri[99]);
 

	    dascr_ .rscrri[99] = 1.;
	    dacon_(& daele_ .alda[l + 5], & dascr_ .rscrri[99]);
 

	    dacop_(& daele_ .alda[l + 1], & dascr_ .iscrda[idaa]);
	    dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 1]);
	    damul_(& dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa], &
		    dascr_ .iscrda[idaa + 2]);
	    dacdi_(& dascr_ .iscrda[idaa + 2], &c_b2382, & dascr_ .iscrda[idaa 
		    + 3]);
	    dacop_(& dascr_ .iscrda[idaa + 3], & daele_ .asda[l + 9]);
 
	}
 

	dasuc_(& daele_ .rv, &c_b2366, & dascr_ .iscrda[idaa]);
	dascr_ .rscrri[idaa + 1] = ell_ .el[i__ - 1];
	d__1 = dascr_ .rscrri[idaa + 1] * 1.;
	dacmu_(& dascr_ .iscrda[idaa], &d__1, & dascr_ .iscrda[idaa + 2]);
	dacmu_(& dascr_ .iscrda[idaa + 2], &c_b2384, & dascr_ .iscrda[idaa + 3])
		;
	dacop_(& dascr_ .iscrda[idaa + 3], daele_ .asda);
	goto L190;
 

 
 
 

L40:
	ih = 1;
L50:
	if ((d__1 = ell_ .ed[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    goto L20;
	}
 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	dascr_ .rscrri[idaa + 1] = ell_ .ed[i__ - 1];
	dascr_ .rscrri[idaa + 2] = dascr_ .rscrri[idaa] * dascr_ .rscrri[idaa 
		+ 1];
	d__1 = dascr_ .rscrri[idaa + 2] * 1.;
	dadic_(&dpsq, &d__1, & dascr_ .iscrda[idaa + 3]);
	dacop_(& dascr_ .iscrda[idaa + 3], &fok);
 

	dascr_ .rscrri[idaa] = ell_ .ed[i__ - 1];
	dascr_ .rscrri[idaa + 1] = 1. / dascr_ .rscrri[idaa];
	d__1 = dascr_ .rscrri[idaa + 1] * 1.;
	dacmu_(&dpsq, &d__1, & dascr_ .iscrda[idaa + 2]);
	dacop_(& dascr_ .iscrda[idaa + 2], &rho);
 

	dacmu_(&fok, &c_b461, & dascr_ .iscrda[idaa]);
	dacmu_(&fok, &c_b461, & dascr_ .iscrda[idaa + 1]);
	dafun_("SIN   ", & dascr_ .iscrda[idaa], & dascr_ .iscrda[idaa + 2], 6L)
		;
	dafun_("COS   ", & dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa + 3],
		 6L);
	dadiv_(& dascr_ .iscrda[idaa + 2], & dascr_ .iscrda[idaa + 3], &
		dascr_ .iscrda[idaa + 4]);
	dadiv_(& dascr_ .iscrda[idaa + 4], &rho, & dascr_ .iscrda[idaa + 5]);
	dacop_(& dascr_ .iscrda[idaa + 5], &fok1);
 

	dafun_("SIN   ", &fok, & dascr_ .iscrda[idaa], 6L);
	dacop_(& dascr_ .iscrda[idaa], &si);
 

	dafun_("COS   ", &fok, & dascr_ .iscrda[idaa], 6L);
	dacop_(& dascr_ .iscrda[idaa], &co);
 

	dascr_ .rscrri[99] = 1.;
	dacon_(& daele_ .alda[ih - 1], & dascr_ .rscrri[99]);
 

	damul_(&rho, &si, & dascr_ .iscrda[idaa]);
	dacop_(& dascr_ .iscrda[idaa], & daele_ .alda[ih + 1]);
 

	dascr_ .rscrri[99] = 0.;
	dacon_(& daele_ .alda[ih + 3], & dascr_ .rscrri[99]);
 

	dascr_ .rscrri[99] = 1.;
	dacon_(& daele_ .alda[ih + 5], & dascr_ .rscrri[99]);
 

	dasuc_(&co, &c_b2366, & dascr_ .iscrda[idaa]);
	dacmu_(& daele_ .dpda, &c_b2381, & dascr_ .iscrda[idaa + 1]);
	damul_(& dascr_ .iscrda[idaa + 1], &rho, & dascr_ .iscrda[idaa + 2]);
	damul_(& dascr_ .iscrda[idaa + 2], & dascr_ .iscrda[idaa], &
		dascr_ .iscrda[idaa + 3]);
	dadiv_(& dascr_ .iscrda[idaa + 3], &dpsq, & dascr_ .iscrda[idaa + 4]);
	dacmu_(& dascr_ .iscrda[idaa + 4], &c_b2384, & dascr_ .iscrda[idaa + 5])
		;
	dacop_(& dascr_ .iscrda[idaa + 5], & daele_ .alda[ih + 7]);
 

	dacmu_(&fok, &c_b461, & dascr_ .iscrda[idaa]);
	dacmu_(&fok, &c_b461, & dascr_ .iscrda[idaa + 1]);
	dafun_("SIN   ", & dascr_ .iscrda[idaa], & dascr_ .iscrda[idaa + 2], 6L)
		;
	dafun_("COS   ", & dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa + 3],
		 6L);
	dacmu_(& daele_ .dpda, &c_b2381, & dascr_ .iscrda[idaa + 4]);
	dacmu_(& dascr_ .iscrda[idaa + 4], &c_b2400, & dascr_ .iscrda[idaa + 5])
		;
	damul_(& dascr_ .iscrda[idaa + 5], & dascr_ .iscrda[idaa + 2], &
		dascr_ .iscrda[idaa + 6]);
	dadiv_(& dascr_ .iscrda[idaa + 6], & dascr_ .iscrda[idaa + 3], &
		dascr_ .iscrda[idaa + 7]);
	dadiv_(& dascr_ .iscrda[idaa + 7], &dpsq, & dascr_ .iscrda[idaa + 8]);
	dacmu_(& dascr_ .iscrda[idaa + 8], &c_b2384, & dascr_ .iscrda[idaa + 9])
		;
	dacop_(& dascr_ .iscrda[idaa + 9], & daele_ .alda[ih + 9]);
 

	dafun_("COS   ", &fok, & dascr_ .iscrda[idaa], 6L);
	dacop_(& dascr_ .iscrda[idaa], &sm1);
 

	dafun_("SIN   ", &fok, & dascr_ .iscrda[idaa], 6L);
	damul_(& dascr_ .iscrda[idaa], &rho, & dascr_ .iscrda[idaa + 1]);
	dacop_(& dascr_ .iscrda[idaa + 1], &sm2);
 

	dafun_("SIN   ", &fok, & dascr_ .iscrda[idaa], 6L);
	dacmu_(& dascr_ .iscrda[idaa], &c_b2381, & dascr_ .iscrda[idaa + 1]);
	dadiv_(& dascr_ .iscrda[idaa + 1], &rho, & dascr_ .iscrda[idaa + 2]);
	dacop_(& dascr_ .iscrda[idaa + 2], &sm3);
 

	dasuc_(&sm1, &c_b2366, & dascr_ .iscrda[idaa]);
	dacmu_(&rho, &c_b2381, & dascr_ .iscrda[idaa + 1]);
	damul_(& dascr_ .iscrda[idaa + 1], &dpsq, & dascr_ .iscrda[idaa + 2]);
	damul_(& dascr_ .iscrda[idaa + 2], & dascr_ .iscrda[idaa], &
		dascr_ .iscrda[idaa + 3]);
	dacop_(& dascr_ .iscrda[idaa + 3], &sm5);
 

	dacmu_(&sm2, &c_b2381, & dascr_ .iscrda[idaa]);
	damul_(& dascr_ .iscrda[idaa], &dpsq, & dascr_ .iscrda[idaa + 1]);
	dadiv_(& dascr_ .iscrda[idaa + 1], &rho, & dascr_ .iscrda[idaa + 2]);
	dacop_(& dascr_ .iscrda[idaa + 2], &sm6);
 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	damul_(&sm1, &sm2, & dascr_ .iscrda[idaa + 1]);
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dasuc_(& dascr_ .iscrda[idaa + 1], &d__1, & dascr_ .iscrda[idaa + 2]);
	dacop_(& dascr_ .iscrda[idaa + 2], &sm12);
 

	damul_(&sm2, &sm3, & dascr_ .iscrda[idaa]);
	dacop_(& dascr_ .iscrda[idaa], &sm23);
 

	dacmu_(&dpsq, &c_b2400, & dascr_ .iscrda[idaa]);
	damul_(& daele_ .dpda, &rho, & dascr_ .iscrda[idaa + 1]);
	dadiv_(& dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa], &
		dascr_ .iscrda[idaa + 2]);
	damul_(& dascr_ .iscrda[idaa + 2], &sm23, & dascr_ .iscrda[idaa + 3]);
	daadd_(& dascr_ .iscrda[idaa + 3], &sm5, & dascr_ .iscrda[idaa + 4]);
	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 5]);
	damul_(& dascr_ .iscrda[idaa + 5], & dascr_ .iscrda[idaa + 4], &
		dascr_ .iscrda[idaa + 6]);
	dacop_(& dascr_ .iscrda[idaa + 6], &as3);
 

	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa]);
	damul_(& dascr_ .iscrda[idaa], &sm23, & dascr_ .iscrda[idaa + 1]);
	dacdi_(& dascr_ .iscrda[idaa + 1], &c_b2382, & dascr_ .iscrda[idaa + 2])
		;
	dacop_(& dascr_ .iscrda[idaa + 2], &as4);
 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	damul_(&sm1, &sm2, & dascr_ .iscrda[idaa + 1]);
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dacad_(& dascr_ .iscrda[idaa + 1], &d__1, & dascr_ .iscrda[idaa + 2]);
	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 3]);
	damul_(& dascr_ .iscrda[idaa + 3], & dascr_ .iscrda[idaa + 2], &
		dascr_ .iscrda[idaa + 4]);
	dacdi_(& dascr_ .iscrda[idaa + 4], &c_b2414, & dascr_ .iscrda[idaa + 5])
		;
	dacop_(& dascr_ .iscrda[idaa + 5], &as6);
 

 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	dacmu_(&dpd, &c_b2415, & dascr_ .iscrda[idaa + 1]);
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dasuc_(&sm2, &d__1, & dascr_ .iscrda[idaa + 2]);
	damul_(& daele_ .dpda, & daele_ .dpda, & dascr_ .iscrda[idaa + 3]);
	dadiv_(& dascr_ .iscrda[idaa + 3], & dascr_ .iscrda[idaa + 1], &
		dascr_ .iscrda[idaa + 4]);
	damul_(& dascr_ .iscrda[idaa + 4], &sm12, & dascr_ .iscrda[idaa + 5]);
	damul_(& daele_ .dpda, & dascr_ .iscrda[idaa + 2], & dascr_ .iscrda[idaa 
		+ 6]);
	daadd_(& dascr_ .iscrda[idaa + 5], & dascr_ .iscrda[idaa + 6], &
		dascr_ .iscrda[idaa + 7]);
	dasuc_(& daele_ .rv, &c_b2366, & dascr_ .iscrda[idaa + 8]);
	dascr_ .rscrri[idaa + 9] = ell_ .el[i__ - 1];
	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 10]);
	damul_(& dascr_ .iscrda[idaa + 10], & dascr_ .iscrda[idaa + 7], &
		dascr_ .iscrda[idaa + 11]);
	d__1 = dascr_ .rscrri[idaa + 9] * 1.;
	dacmu_(& dascr_ .iscrda[idaa + 8], &d__1, & dascr_ .iscrda[idaa + 12]);
	daadd_(& dascr_ .iscrda[idaa + 11], & dascr_ .iscrda[idaa + 12], &
		dascr_ .iscrda[idaa + 13]);
	dacmu_(& dascr_ .iscrda[idaa + 13], &c_b2384, & dascr_ .iscrda[idaa + 
		14]);
	dacop_(& dascr_ .iscrda[idaa + 14], & daele_ .asda[ih - 1]);
 

	dacmu_(&rho, &c_b2400, & dascr_ .iscrda[idaa]);
	damul_(& dascr_ .iscrda[idaa], &dpsq, & dascr_ .iscrda[idaa + 1]);
	dadiv_(& daele_ .dpda, & dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa 
		+ 2]);
	damul_(& dascr_ .iscrda[idaa + 2], &sm12, & dascr_ .iscrda[idaa + 3]);
	daadd_(& dascr_ .iscrda[idaa + 3], &sm6, & dascr_ .iscrda[idaa + 4]);
	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 5]);
	damul_(& dascr_ .iscrda[idaa + 5], & dascr_ .iscrda[idaa + 4], &
		dascr_ .iscrda[idaa + 6]);
	damul_(&fok1, &as3, & dascr_ .iscrda[idaa + 7]);
	daadd_(& dascr_ .iscrda[idaa + 6], & dascr_ .iscrda[idaa + 7], &
		dascr_ .iscrda[idaa + 8]);
	dacop_(& dascr_ .iscrda[idaa + 8], & daele_ .asda[ih + 1]);
 

	dacop_(&as3, & daele_ .asda[ih + 3]);
 

	dacmu_(&as6, &c_b2400, & dascr_ .iscrda[idaa]);
	damul_(& dascr_ .iscrda[idaa], &fok1, & dascr_ .iscrda[idaa + 1]);
	daadd_(&as4, & dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa + 2]);
	dacop_(& dascr_ .iscrda[idaa + 2], & daele_ .asda[ih + 5]);
 

	dacmu_(&rho, &c_b2414, & dascr_ .iscrda[idaa]);
	damul_(& dascr_ .iscrda[idaa], &rho, & dascr_ .iscrda[idaa + 1]);
	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 2]);
	damul_(& dascr_ .iscrda[idaa + 2], &sm12, & dascr_ .iscrda[idaa + 3]);
	dadiv_(& dascr_ .iscrda[idaa + 3], & dascr_ .iscrda[idaa + 1], &
		dascr_ .iscrda[idaa + 4]);
	damul_(&as6, &fok1, & dascr_ .iscrda[idaa + 5]);
	damul_(& dascr_ .iscrda[idaa + 5], &fok1, & dascr_ .iscrda[idaa + 6]);
	damul_(&fok1, &as4, & dascr_ .iscrda[idaa + 7]);
	daadd_(& dascr_ .iscrda[idaa + 4], & dascr_ .iscrda[idaa + 6], &
		dascr_ .iscrda[idaa + 8]);
	daadd_(& dascr_ .iscrda[idaa + 8], & dascr_ .iscrda[idaa + 7], &
		dascr_ .iscrda[idaa + 9]);
	dacop_(& dascr_ .iscrda[idaa + 9], & daele_ .asda[ih + 7]);
 

	dacop_(&as6, & daele_ .asda[ih + 9]);
 
	++ih;
	if (ih > 2) {
	    ih = 1;
	}
 

	dacmu_(&fok, &c_b461, & dascr_ .iscrda[idaa]);
	dacmu_(&fok, &c_b461, & dascr_ .iscrda[idaa + 1]);
	dafun_("SIN   ", & dascr_ .iscrda[idaa], & dascr_ .iscrda[idaa + 2], 6L)
		;
	dafun_("COS   ", & dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa + 3],
		 6L);
	dadiv_(& dascr_ .iscrda[idaa + 2], & dascr_ .iscrda[idaa + 3], &
		dascr_ .iscrda[idaa + 4]);
	dadiv_(& dascr_ .iscrda[idaa + 4], &rho, & dascr_ .iscrda[idaa + 5]);
	dacop_(& dascr_ .iscrda[idaa + 5], &g);
 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dacmu_(&g, &d__1, & dascr_ .iscrda[idaa + 1]);
	dacop_(& dascr_ .iscrda[idaa + 1], &gl);
 

	dasuc_(&gl, &c_b2366, & dascr_ .iscrda[idaa]);
	dacop_(& dascr_ .iscrda[idaa], & daele_ .alda[ih - 1]);
 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	dascr_ .rscrri[99] = dascr_ .rscrri[idaa];
	dacon_(& daele_ .alda[ih + 1], & dascr_ .rscrri[99]);
 

	dasuc_(&gl, &c_b2400, & dascr_ .iscrda[idaa]);
	dacmu_(&g, &c_b2381, & dascr_ .iscrda[idaa + 1]);
	damul_(& dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa], &
		dascr_ .iscrda[idaa + 2]);
	dacop_(& dascr_ .iscrda[idaa + 2], & daele_ .alda[ih + 3]);
 

	dacop_(& daele_ .alda[ih - 1], & dascr_ .iscrda[idaa]);
	dacop_(& dascr_ .iscrda[idaa], & daele_ .alda[ih + 5]);
 

	dacop_(& daele_ .alda[ih + 1], & dascr_ .iscrda[idaa]);
	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 1]);
	damul_(& dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa], &
		dascr_ .iscrda[idaa + 2]);
	dacdi_(& dascr_ .iscrda[idaa + 2], &c_b2382, & dascr_ .iscrda[idaa + 3])
		;
	dacop_(& dascr_ .iscrda[idaa + 3], &as6);
 

	dascr_ .rscrri[idaa] = -2.;
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dacmu_(&as6, &d__1, & dascr_ .iscrda[idaa + 1]);
	damul_(& dascr_ .iscrda[idaa + 1], &fok1, & dascr_ .iscrda[idaa + 2]);
	dacop_(& dascr_ .iscrda[idaa + 2], & daele_ .asda[ih + 5]);
 

	damul_(&as6, &fok1, & dascr_ .iscrda[idaa]);
	damul_(& dascr_ .iscrda[idaa], &fok1, & dascr_ .iscrda[idaa + 1]);
	dacop_(& dascr_ .iscrda[idaa + 1], & daele_ .asda[ih + 7]);
 

	dacop_(&as6, & daele_ .asda[ih + 9]);
	goto L190;
 

 
 
 

L60:
	ih = 1;
L70:
	if ((d__1 = ell_ .ed[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    goto L20;
	}
 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	dascr_ .rscrri[idaa + 1] = ell_ .ed[i__ - 1];
	dascr_ .rscrri[idaa + 2] = dascr_ .rscrri[idaa] * dascr_ .rscrri[idaa 
		+ 1];
	d__1 = dascr_ .rscrri[idaa + 2] * 1.;
	dadic_(&dpsq, &d__1, & dascr_ .iscrda[idaa + 3]);
	dacop_(& dascr_ .iscrda[idaa + 3], &fok);
 

	dascr_ .rscrri[idaa] = ell_ .ed[i__ - 1];
	dascr_ .rscrri[idaa + 1] = 1. / dascr_ .rscrri[idaa];
	d__1 = dascr_ .rscrri[idaa + 1] * 1.;
	dacmu_(&dpsq, &d__1, & dascr_ .iscrda[idaa + 2]);
	dacop_(& dascr_ .iscrda[idaa + 2], &rho);
 

	dafun_("SIN   ", &fok, & dascr_ .iscrda[idaa], 6L);
	dacop_(& dascr_ .iscrda[idaa], &si);
 

	dafun_("COS   ", &fok, & dascr_ .iscrda[idaa], 6L);
	dacop_(& dascr_ .iscrda[idaa], &co);
 

	dasuc_(&co, &c_b2366, & dascr_ .iscrda[idaa]);
	damul_(&rho, & dascr_ .iscrda[idaa], & dascr_ .iscrda[idaa + 1]);
	dadiv_(& dascr_ .iscrda[idaa + 1], &dpsq, & dascr_ .iscrda[idaa + 2]);
	dacop_(& dascr_ .iscrda[idaa + 2], &rhoc);
 

	dadiv_(&si, &dpsq, & dascr_ .iscrda[idaa]);
	dacop_(& dascr_ .iscrda[idaa], &siq);
 

	dacop_(&co, & daele_ .alda[ih - 1]);
 

	damul_(&rho, &si, & dascr_ .iscrda[idaa]);
	dacop_(& dascr_ .iscrda[idaa], & daele_ .alda[ih + 1]);
 

	dacmu_(&si, &c_b2381, & dascr_ .iscrda[idaa]);
	dadiv_(& dascr_ .iscrda[idaa], &rho, & dascr_ .iscrda[idaa + 1]);
	dacop_(& dascr_ .iscrda[idaa + 1], & daele_ .alda[ih + 3]);
 

	dacop_(&co, & daele_ .alda[ih + 5]);
 

	dacmu_(& daele_ .dpda, &c_b2381, & dascr_ .iscrda[idaa]);
	damul_(& dascr_ .iscrda[idaa], &rhoc, & dascr_ .iscrda[idaa + 1]);
	dacmu_(& dascr_ .iscrda[idaa + 1], &c_b2384, & dascr_ .iscrda[idaa + 2])
		;
	dacop_(& dascr_ .iscrda[idaa + 2], & daele_ .alda[ih + 7]);
 

	dacmu_(& daele_ .dpda, &c_b2381, & dascr_ .iscrda[idaa]);
	damul_(& dascr_ .iscrda[idaa], &siq, & dascr_ .iscrda[idaa + 1]);
	dacmu_(& dascr_ .iscrda[idaa + 1], &c_b2384, & dascr_ .iscrda[idaa + 2])
		;
	dacop_(& dascr_ .iscrda[idaa + 2], & daele_ .alda[ih + 9]);
 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	dacop_(& daele_ .alda[ih - 1], & dascr_ .iscrda[idaa + 1]);
	dacop_(& daele_ .alda[ih + 1], & dascr_ .iscrda[idaa + 2]);
	damul_(& dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa + 2], &
		dascr_ .iscrda[idaa + 3]);
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dasuc_(& dascr_ .iscrda[idaa + 3], &d__1, & dascr_ .iscrda[idaa + 4]);
	dacop_(& dascr_ .iscrda[idaa + 4], &sm12);
 

	dacop_(& daele_ .alda[ih + 1], & dascr_ .iscrda[idaa]);
	dacop_(& daele_ .alda[ih + 3], & dascr_ .iscrda[idaa + 1]);
	damul_(& dascr_ .iscrda[idaa], & dascr_ .iscrda[idaa + 1], &
		dascr_ .iscrda[idaa + 2]);
	dacop_(& dascr_ .iscrda[idaa + 2], &sm23);
 

 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	dacop_(& daele_ .alda[ih + 1], & dascr_ .iscrda[idaa + 1]);
	dacmu_(&dpd, &c_b2415, & dascr_ .iscrda[idaa + 2]);
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dasuc_(& dascr_ .iscrda[idaa + 1], &d__1, & dascr_ .iscrda[idaa + 3]);
	damul_(& daele_ .dpda, & daele_ .dpda, & dascr_ .iscrda[idaa + 4]);
	dadiv_(& dascr_ .iscrda[idaa + 4], & dascr_ .iscrda[idaa + 2], &
		dascr_ .iscrda[idaa + 5]);
	damul_(& dascr_ .iscrda[idaa + 5], &sm12, & dascr_ .iscrda[idaa + 6]);
	damul_(& daele_ .dpda, & dascr_ .iscrda[idaa + 3], & dascr_ .iscrda[idaa 
		+ 7]);
	daadd_(& dascr_ .iscrda[idaa + 6], & dascr_ .iscrda[idaa + 7], &
		dascr_ .iscrda[idaa + 8]);
	dasuc_(& daele_ .rv, &c_b2366, & dascr_ .iscrda[idaa + 9]);
	dascr_ .rscrri[idaa + 10] = ell_ .el[i__ - 1];
	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 11]);
	damul_(& dascr_ .iscrda[idaa + 11], & dascr_ .iscrda[idaa + 8], &
		dascr_ .iscrda[idaa + 12]);
	d__1 = dascr_ .rscrri[idaa + 10] * 1.;
	dacmu_(& dascr_ .iscrda[idaa + 9], &d__1, & dascr_ .iscrda[idaa + 13]);
	daadd_(& dascr_ .iscrda[idaa + 12], & dascr_ .iscrda[idaa + 13], &
		dascr_ .iscrda[idaa + 14]);
	dacmu_(& dascr_ .iscrda[idaa + 14], &c_b2384, & dascr_ .iscrda[idaa + 
		15]);
	dacop_(& dascr_ .iscrda[idaa + 15], & daele_ .asda[ih - 1]);
 

	dacmu_(&rho, &c_b2400, & dascr_ .iscrda[idaa]);
	damul_(& dascr_ .iscrda[idaa], &dpsq, & dascr_ .iscrda[idaa + 1]);
	dadiv_(& daele_ .dpda, & dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa 
		+ 2]);
	damul_(& dascr_ .iscrda[idaa + 2], &sm12, & dascr_ .iscrda[idaa + 3]);
	damul_(&dpd, &siq, & dascr_ .iscrda[idaa + 4]);
	dasub_(& dascr_ .iscrda[idaa + 3], & dascr_ .iscrda[idaa + 4], &
		dascr_ .iscrda[idaa + 5]);
	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 6]);
	damul_(& dascr_ .iscrda[idaa + 6], & dascr_ .iscrda[idaa + 5], &
		dascr_ .iscrda[idaa + 7]);
	dacop_(& dascr_ .iscrda[idaa + 7], & daele_ .asda[ih + 1]);
 

	dacmu_(&dpsq, &c_b2400, & dascr_ .iscrda[idaa]);
	damul_(& daele_ .dpda, &rho, & dascr_ .iscrda[idaa + 1]);
	dadiv_(& dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa], &
		dascr_ .iscrda[idaa + 2]);
	damul_(& dascr_ .iscrda[idaa + 2], &sm23, & dascr_ .iscrda[idaa + 3]);
	damul_(&dpd, &rhoc, & dascr_ .iscrda[idaa + 4]);
	dasub_(& dascr_ .iscrda[idaa + 3], & dascr_ .iscrda[idaa + 4], &
		dascr_ .iscrda[idaa + 5]);
	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 6]);
	damul_(& dascr_ .iscrda[idaa + 6], & dascr_ .iscrda[idaa + 5], &
		dascr_ .iscrda[idaa + 7]);
	dacop_(& dascr_ .iscrda[idaa + 7], & daele_ .asda[ih + 3]);
 

	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa]);
	damul_(& dascr_ .iscrda[idaa], &sm23, & dascr_ .iscrda[idaa + 1]);
	dacdi_(& dascr_ .iscrda[idaa + 1], &c_b2382, & dascr_ .iscrda[idaa + 2])
		;
	dacop_(& dascr_ .iscrda[idaa + 2], & daele_ .asda[ih + 5]);
 

	dacmu_(&rho, &c_b2414, & dascr_ .iscrda[idaa]);
	damul_(& dascr_ .iscrda[idaa], &rho, & dascr_ .iscrda[idaa + 1]);
	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 2]);
	damul_(& dascr_ .iscrda[idaa + 2], &sm12, & dascr_ .iscrda[idaa + 3]);
	dadiv_(& dascr_ .iscrda[idaa + 3], & dascr_ .iscrda[idaa + 1], &
		dascr_ .iscrda[idaa + 4]);
	dacop_(& dascr_ .iscrda[idaa + 4], & daele_ .asda[ih + 7]);
 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	dacop_(& daele_ .alda[ih - 1], & dascr_ .iscrda[idaa + 1]);
	dacop_(& daele_ .alda[ih + 1], & dascr_ .iscrda[idaa + 2]);
	damul_(& dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa + 2], &
		dascr_ .iscrda[idaa + 3]);
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dacad_(& dascr_ .iscrda[idaa + 3], &d__1, & dascr_ .iscrda[idaa + 4]);
	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 5]);
	damul_(& dascr_ .iscrda[idaa + 5], & dascr_ .iscrda[idaa + 4], &
		dascr_ .iscrda[idaa + 6]);
	dacdi_(& dascr_ .iscrda[idaa + 6], &c_b2414, & dascr_ .iscrda[idaa + 7])
		;
	dacop_(& dascr_ .iscrda[idaa + 7], & daele_ .asda[ih + 9]);
 
	++ih;
	if (ih > 2) {
	    ih = 1;
	}
 

	dascr_ .rscrri[99] = 1.;
	dacon_(& daele_ .alda[ih - 1], & dascr_ .rscrri[99]);
 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	dascr_ .rscrri[99] = dascr_ .rscrri[idaa];
	dacon_(& daele_ .alda[ih + 1], & dascr_ .rscrri[99]);
 

	dascr_ .rscrri[99] = 0.;
	dacon_(& daele_ .alda[ih + 3], & dascr_ .rscrri[99]);
 

	dascr_ .rscrri[99] = 1.;
	dacon_(& daele_ .alda[ih + 5], & dascr_ .rscrri[99]);
 

	dacop_(& daele_ .alda[ih + 1], & dascr_ .iscrda[idaa]);
	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 1]);
	damul_(& dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa], &
		dascr_ .iscrda[idaa + 2]);
	dacdi_(& dascr_ .iscrda[idaa + 2], &c_b2382, & dascr_ .iscrda[idaa + 3])
		;
	dacop_(& dascr_ .iscrda[idaa + 3], & daele_ .asda[ih + 9]);
	goto L190;
 

 
 

L80:
	ih = 2;
	goto L50;
 

 
 

L90:
	ih = 2;
	goto L70;
 

 
 
 

L100:
	if ((d__1 = ell_ .ek[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    goto L20;
	}
 

	dacad_(& daele_ .dpda, &c_b2366, & dascr_ .iscrda[idaa]);
	dascr_ .rscrri[idaa + 1] = ell_ .ek[i__ - 1];
	d__1 = dascr_ .rscrri[idaa + 1] * 1.;
	dadic_(& dascr_ .iscrda[idaa], &d__1, & dascr_ .iscrda[idaa + 2]);
	dacop_(& dascr_ .iscrda[idaa + 2], &fok);
 

 

	dacop_(&fok, &aek);
	if (dare_(&aek) < 0.) {
 

	    dacmu_(&aek, &c_b2381, & dascr_ .iscrda[idaa]);
	    dacop_(& dascr_ .iscrda[idaa], &aek);
	}
	ih = 0;
 

	dafun_("SQRT  ", &aek, & dascr_ .iscrda[idaa], 6L);
	dacop_(& dascr_ .iscrda[idaa], &hi);
 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dacmu_(&hi, &d__1, & dascr_ .iscrda[idaa + 1]);
	dacop_(& dascr_ .iscrda[idaa + 1], &fi);
	if (ell_ .ek[i__ - 1] > 0.) {
	    goto L120;
	}
L110:
	++ih;
 

	dafun_("COS   ", &fi, & dascr_ .iscrda[idaa], 6L);
	dacop_(& dascr_ .iscrda[idaa], & daele_ .alda[ih - 1]);
 

	dafun_("SIN   ", &fi, & dascr_ .iscrda[idaa], 6L);
	dacop_(& dascr_ .iscrda[idaa], &hi1);
 

	dadiv_(&hi1, &hi, & dascr_ .iscrda[idaa]);
	dacop_(& dascr_ .iscrda[idaa], & daele_ .alda[ih + 1]);
 

	dacmu_(&hi1, &c_b2381, & dascr_ .iscrda[idaa]);
	damul_(& dascr_ .iscrda[idaa], &hi, & dascr_ .iscrda[idaa + 1]);
	dacop_(& dascr_ .iscrda[idaa + 1], & daele_ .alda[ih + 3]);
 

	dacop_(& daele_ .alda[ih - 1], & dascr_ .iscrda[idaa]);
	dacop_(& dascr_ .iscrda[idaa], & daele_ .alda[ih + 5]);
 

	dasuc_(& daele_ .rv, &c_b2366, & dascr_ .iscrda[idaa]);
	dascr_ .rscrri[idaa + 1] = ell_ .el[i__ - 1];
	d__1 = dascr_ .rscrri[idaa + 1] * 1.;
	dacmu_(& dascr_ .iscrda[idaa], &d__1, & dascr_ .iscrda[idaa + 2]);
	dacmu_(& dascr_ .iscrda[idaa + 2], &c_b2384, & dascr_ .iscrda[idaa + 3])
		;
	dacop_(& dascr_ .iscrda[idaa + 3], & daele_ .asda[ih - 1]);
 

	dacop_(& daele_ .alda[ih + 1], & dascr_ .iscrda[idaa]);
	dacop_(& daele_ .alda[ih + 3], & dascr_ .iscrda[idaa + 1]);
	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 2]);
	damul_(& dascr_ .iscrda[idaa + 2], & dascr_ .iscrda[idaa], &
		dascr_ .iscrda[idaa + 3]);
	damul_(& dascr_ .iscrda[idaa + 3], & dascr_ .iscrda[idaa + 1], &
		dascr_ .iscrda[idaa + 4]);
	dacdi_(& dascr_ .iscrda[idaa + 4], &c_b2382, & dascr_ .iscrda[idaa + 5])
		;
	dacop_(& dascr_ .iscrda[idaa + 5], & daele_ .asda[ih + 5]);
 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	dacop_(& daele_ .alda[ih - 1], & dascr_ .iscrda[idaa + 1]);
	dacop_(& daele_ .alda[ih + 1], & dascr_ .iscrda[idaa + 2]);
	damul_(& dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa + 2], &
		dascr_ .iscrda[idaa + 3]);
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dasuc_(& dascr_ .iscrda[idaa + 3], &d__1, & dascr_ .iscrda[idaa + 4]);
	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 5]);
	damul_(& dascr_ .iscrda[idaa + 5], & dascr_ .iscrda[idaa + 4], &
		dascr_ .iscrda[idaa + 6]);
	damul_(& dascr_ .iscrda[idaa + 6], &aek, & dascr_ .iscrda[idaa + 7]);
	dacdi_(& dascr_ .iscrda[idaa + 7], &c_b2414, & dascr_ .iscrda[idaa + 8])
		;
	dacop_(& dascr_ .iscrda[idaa + 8], & daele_ .asda[ih + 7]);
 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	dacop_(& daele_ .alda[ih - 1], & dascr_ .iscrda[idaa + 1]);
	dacop_(& daele_ .alda[ih + 1], & dascr_ .iscrda[idaa + 2]);
	damul_(& dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa + 2], &
		dascr_ .iscrda[idaa + 3]);
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dacad_(& dascr_ .iscrda[idaa + 3], &d__1, & dascr_ .iscrda[idaa + 4]);
	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 5]);
	damul_(& dascr_ .iscrda[idaa + 5], & dascr_ .iscrda[idaa + 4], &
		dascr_ .iscrda[idaa + 6]);
	dacdi_(& dascr_ .iscrda[idaa + 6], &c_b2414, & dascr_ .iscrda[idaa + 7])
		;
	dacop_(& dascr_ .iscrda[idaa + 7], & daele_ .asda[ih + 9]);
	if (ih == 2) {
	    goto L190;
	}
 
L120:
	++ih;
 

	dafun_("EXP   ", &fi, & dascr_ .iscrda[idaa], 6L);
	dacop_(& dascr_ .iscrda[idaa], &hp);
 

	dadic_(&hp, &c_b2366, & dascr_ .iscrda[idaa]);
	dacop_(& dascr_ .iscrda[idaa], &hm);
 

	daadd_(&hp, &hm, & dascr_ .iscrda[idaa]);
	dacmu_(& dascr_ .iscrda[idaa], &c_b461, & dascr_ .iscrda[idaa + 1]);
	dacop_(& dascr_ .iscrda[idaa + 1], &hc);
 

	dasub_(&hp, &hm, & dascr_ .iscrda[idaa]);
	dacmu_(& dascr_ .iscrda[idaa], &c_b461, & dascr_ .iscrda[idaa + 1]);
	dacop_(& dascr_ .iscrda[idaa + 1], &hs);
 

	dacop_(&hc, & daele_ .alda[ih - 1]);
 

	dadiv_(&hs, &hi, & dascr_ .iscrda[idaa]);
	dacop_(& dascr_ .iscrda[idaa], & daele_ .alda[ih + 1]);
 

	damul_(&hs, &hi, & dascr_ .iscrda[idaa]);
	dacop_(& dascr_ .iscrda[idaa], & daele_ .alda[ih + 3]);
 

	dacop_(&hc, & daele_ .alda[ih + 5]);
 

	dacop_(& daele_ .alda[ih + 1], & dascr_ .iscrda[idaa]);
	dacop_(& daele_ .alda[ih + 3], & dascr_ .iscrda[idaa + 1]);
	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 2]);
	damul_(& dascr_ .iscrda[idaa + 2], & dascr_ .iscrda[idaa], &
		dascr_ .iscrda[idaa + 3]);
	damul_(& dascr_ .iscrda[idaa + 3], & dascr_ .iscrda[idaa + 1], &
		dascr_ .iscrda[idaa + 4]);
	dacdi_(& dascr_ .iscrda[idaa + 4], &c_b2382, & dascr_ .iscrda[idaa + 5])
		;
	dacop_(& dascr_ .iscrda[idaa + 5], & daele_ .asda[ih + 5]);
 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	dacop_(& daele_ .alda[ih - 1], & dascr_ .iscrda[idaa + 1]);
	dacop_(& daele_ .alda[ih + 1], & dascr_ .iscrda[idaa + 2]);
	damul_(& dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa + 2], &
		dascr_ .iscrda[idaa + 3]);
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dasuc_(& dascr_ .iscrda[idaa + 3], &d__1, & dascr_ .iscrda[idaa + 4]);
	damul_(& daele_ .rv, & dascr_ .iscrda[idaa + 4], & dascr_ .iscrda[idaa + 
		5]);
	damul_(& dascr_ .iscrda[idaa + 5], &aek, & dascr_ .iscrda[idaa + 6]);
	dacdi_(& dascr_ .iscrda[idaa + 6], &c_b2414, & dascr_ .iscrda[idaa + 7])
		;
	dacop_(& dascr_ .iscrda[idaa + 7], & daele_ .asda[ih + 7]);
 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	dacop_(& daele_ .alda[ih - 1], & dascr_ .iscrda[idaa + 1]);
	dacop_(& daele_ .alda[ih + 1], & dascr_ .iscrda[idaa + 2]);
	damul_(& dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa + 2], &
		dascr_ .iscrda[idaa + 3]);
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dacad_(& dascr_ .iscrda[idaa + 3], &d__1, & dascr_ .iscrda[idaa + 4]);
	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 5]);
	damul_(& dascr_ .iscrda[idaa + 5], & dascr_ .iscrda[idaa + 4], &
		dascr_ .iscrda[idaa + 6]);
	dacdi_(& dascr_ .iscrda[idaa + 6], &c_b2414, & dascr_ .iscrda[idaa + 7])
		;
	dacop_(& dascr_ .iscrda[idaa + 7], & daele_ .asda[ih + 9]);
	if (ih == 1) {
	    goto L110;
	}
	goto L190;
 

 
 
 

L130:
	ih = 0;
 

	dascr_ .rscrri[idaa] = ell_ .ek[i__ - 1];
	dascr_ .rscrri[99] = dascr_ .rscrri[idaa];
	dacon_(&fokq, & dascr_ .rscrri[99]);
L140:
	if ((d__1 = ell_ .ek[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    goto L60;
	}
	if ((d__1 = ell_ .ed[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    goto L100;
	}
	if ((d__1 = ell_ .ek[i__ - 1] - ell_ .ed[i__ - 1] * ell_ .ed[i__ - 1],
		 (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    goto L20;
	}
 

	dascr_ .rscrri[idaa] = ell_ .ed[i__ - 1];
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dadic_(&dpsq, &d__1, & dascr_ .iscrda[idaa + 1]);
	dacop_(& dascr_ .iscrda[idaa + 1], &wf);
 

	dadiv_(&fokq, &dpd, & dascr_ .iscrda[idaa]);
	damul_(&wf, &wf, & dascr_ .iscrda[idaa + 1]);
	dasub_(& dascr_ .iscrda[idaa], & dascr_ .iscrda[idaa + 1], &
		dascr_ .iscrda[idaa + 2]);
	dacop_(& dascr_ .iscrda[idaa + 2], &fok);
 

 

	dacop_(&fok, &afok);
	if (dare_(&afok) < 0.) {
 

	    dacmu_(&afok, &c_b2381, & dascr_ .iscrda[idaa]);
	    dacop_(& dascr_ .iscrda[idaa], &afok);
	}
 

	dafun_("SQRT  ", &afok, & dascr_ .iscrda[idaa], 6L);
	dacop_(& dascr_ .iscrda[idaa], &hi);
 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dacmu_(&hi, &d__1, & dascr_ .iscrda[idaa + 1]);
	dacop_(& dascr_ .iscrda[idaa + 1], &fi);
	if (dare_(&fok) > 0.) {
	    goto L160;
	}
 
	++ih;
 

	dafun_("SIN   ", &fi, & dascr_ .iscrda[idaa], 6L);
	dacop_(& dascr_ .iscrda[idaa], &si);
 

	dafun_("COS   ", &fi, & dascr_ .iscrda[idaa], 6L);
	dacop_(& dascr_ .iscrda[idaa], &co);
 

	dasuc_(&co, &c_b2366, & dascr_ .iscrda[idaa]);
	dadiv_(&wf, &afok, & dascr_ .iscrda[idaa + 1]);
	damul_(& dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa], &
		dascr_ .iscrda[idaa + 2]);
	dadiv_(& dascr_ .iscrda[idaa + 2], &dpsq, & dascr_ .iscrda[idaa + 3]);
	dacop_(& dascr_ .iscrda[idaa + 3], &wfa);
 

	dadiv_(&wf, &hi, & dascr_ .iscrda[idaa]);
	damul_(& dascr_ .iscrda[idaa], &si, & dascr_ .iscrda[idaa + 1]);
	dadiv_(& dascr_ .iscrda[idaa + 1], &dpsq, & dascr_ .iscrda[idaa + 2]);
	dacop_(& dascr_ .iscrda[idaa + 2], &wfhi);
 

	dacop_(&co, & daele_ .alda[ih - 1]);
 

	dadiv_(&si, &hi, & dascr_ .iscrda[idaa]);
	dacop_(& dascr_ .iscrda[idaa], & daele_ .alda[ih + 1]);
 

	dacmu_(&si, &c_b2381, & dascr_ .iscrda[idaa]);
	damul_(& dascr_ .iscrda[idaa], &hi, & dascr_ .iscrda[idaa + 1]);
	dacop_(& dascr_ .iscrda[idaa + 1], & daele_ .alda[ih + 3]);
 

	dacop_(&co, & daele_ .alda[ih + 5]);
 

	dacmu_(&wfa, &c_b2381, & dascr_ .iscrda[idaa]);
	damul_(& dascr_ .iscrda[idaa], & daele_ .dpda, & dascr_ .iscrda[idaa + 1]
		);
	dacmu_(& dascr_ .iscrda[idaa + 1], &c_b2384, & dascr_ .iscrda[idaa + 2])
		;
	dacop_(& dascr_ .iscrda[idaa + 2], & daele_ .alda[ih + 7]);
 

	dacmu_(&wfhi, &c_b2381, & dascr_ .iscrda[idaa]);
	damul_(& dascr_ .iscrda[idaa], & daele_ .dpda, & dascr_ .iscrda[idaa + 1]
		);
	dacmu_(& dascr_ .iscrda[idaa + 1], &c_b2384, & dascr_ .iscrda[idaa + 2])
		;
	dacop_(& dascr_ .iscrda[idaa + 2], & daele_ .alda[ih + 9]);
 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	dacop_(& daele_ .alda[ih - 1], & dascr_ .iscrda[idaa + 1]);
	dacop_(& daele_ .alda[ih + 1], & dascr_ .iscrda[idaa + 2]);
	damul_(& dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa + 2], &
		dascr_ .iscrda[idaa + 3]);
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dasuc_(& dascr_ .iscrda[idaa + 3], &d__1, & dascr_ .iscrda[idaa + 4]);
	dacop_(& dascr_ .iscrda[idaa + 4], &sm12);
 

	dacop_(& daele_ .alda[ih + 1], & dascr_ .iscrda[idaa]);
	dacop_(& daele_ .alda[ih + 3], & dascr_ .iscrda[idaa + 1]);
	damul_(& dascr_ .iscrda[idaa], & dascr_ .iscrda[idaa + 1], &
		dascr_ .iscrda[idaa + 2]);
	dacop_(& dascr_ .iscrda[idaa + 2], &sm23);
 

 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	dacop_(& daele_ .alda[ih + 1], & dascr_ .iscrda[idaa + 1]);
	dacmu_(&dpd, &c_b2415, & dascr_ .iscrda[idaa + 2]);
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dasuc_(& dascr_ .iscrda[idaa + 1], &d__1, & dascr_ .iscrda[idaa + 3]);
	damul_(& daele_ .dpda, & daele_ .dpda, & dascr_ .iscrda[idaa + 4]);
	dadiv_(& dascr_ .iscrda[idaa + 4], & dascr_ .iscrda[idaa + 2], &
		dascr_ .iscrda[idaa + 5]);
	damul_(& dascr_ .iscrda[idaa + 5], &sm12, & dascr_ .iscrda[idaa + 6]);
	damul_(& daele_ .dpda, & dascr_ .iscrda[idaa + 3], & dascr_ .iscrda[idaa 
		+ 7]);
	daadd_(& dascr_ .iscrda[idaa + 6], & dascr_ .iscrda[idaa + 7], &
		dascr_ .iscrda[idaa + 8]);
	dasuc_(& daele_ .rv, &c_b2366, & dascr_ .iscrda[idaa + 9]);
	dascr_ .rscrri[idaa + 10] = ell_ .el[i__ - 1];
	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 11]);
	damul_(& dascr_ .iscrda[idaa + 11], & dascr_ .iscrda[idaa + 8], &
		dascr_ .iscrda[idaa + 12]);
	dadiv_(& dascr_ .iscrda[idaa + 12], &afok, & dascr_ .iscrda[idaa + 13]);
	damul_(& dascr_ .iscrda[idaa + 13], &wf, & dascr_ .iscrda[idaa + 14]);
	damul_(& dascr_ .iscrda[idaa + 14], &wf, & dascr_ .iscrda[idaa + 15]);
	d__1 = dascr_ .rscrri[idaa + 10] * 1.;
	dacmu_(& dascr_ .iscrda[idaa + 9], &d__1, & dascr_ .iscrda[idaa + 16]);
	daadd_(& dascr_ .iscrda[idaa + 15], & dascr_ .iscrda[idaa + 16], &
		dascr_ .iscrda[idaa + 17]);
	dacmu_(& dascr_ .iscrda[idaa + 17], &c_b2384, & dascr_ .iscrda[idaa + 
		18]);
	dacop_(& dascr_ .iscrda[idaa + 18], & daele_ .asda[ih - 1]);
 

	dacmu_(&dpsq, &c_b2400, & dascr_ .iscrda[idaa]);
	damul_(& daele_ .dpda, &wf, & dascr_ .iscrda[idaa + 1]);
	dadiv_(& dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa], &
		dascr_ .iscrda[idaa + 2]);
	damul_(& dascr_ .iscrda[idaa + 2], &sm12, & dascr_ .iscrda[idaa + 3]);
	damul_(&dpd, &wfhi, & dascr_ .iscrda[idaa + 4]);
	dasub_(& dascr_ .iscrda[idaa + 3], & dascr_ .iscrda[idaa + 4], &
		dascr_ .iscrda[idaa + 5]);
	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 6]);
	damul_(& dascr_ .iscrda[idaa + 6], & dascr_ .iscrda[idaa + 5], &
		dascr_ .iscrda[idaa + 7]);
	dacop_(& dascr_ .iscrda[idaa + 7], & daele_ .asda[ih + 1]);
 

	dascr_ .rscrri[idaa] = ell_ .ed[i__ - 1];
	dacmu_(& daele_ .dpda, &c_b461, & dascr_ .iscrda[idaa + 1]);
	dadiv_(& dascr_ .iscrda[idaa + 1], &afok, & dascr_ .iscrda[idaa + 2]);
	dadiv_(& dascr_ .iscrda[idaa + 2], &dpd, & dascr_ .iscrda[idaa + 3]);
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dacmu_(& dascr_ .iscrda[idaa + 3], &d__1, & dascr_ .iscrda[idaa + 4]);
	damul_(& dascr_ .iscrda[idaa + 4], &sm23, & dascr_ .iscrda[idaa + 5]);
	damul_(&dpd, &wfa, & dascr_ .iscrda[idaa + 6]);
	dasub_(& dascr_ .iscrda[idaa + 5], & dascr_ .iscrda[idaa + 6], &
		dascr_ .iscrda[idaa + 7]);
	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 8]);
	damul_(& dascr_ .iscrda[idaa + 8], & dascr_ .iscrda[idaa + 7], &
		dascr_ .iscrda[idaa + 9]);
	dacop_(& dascr_ .iscrda[idaa + 9], & daele_ .asda[ih + 3]);
 

	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa]);
	damul_(& dascr_ .iscrda[idaa], &sm23, & dascr_ .iscrda[idaa + 1]);
	dacdi_(& dascr_ .iscrda[idaa + 1], &c_b2382, & dascr_ .iscrda[idaa + 2])
		;
	dacop_(& dascr_ .iscrda[idaa + 2], & daele_ .asda[ih + 5]);
 

	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa]);
	damul_(& dascr_ .iscrda[idaa], &sm12, & dascr_ .iscrda[idaa + 1]);
	damul_(& dascr_ .iscrda[idaa + 1], &afok, & dascr_ .iscrda[idaa + 2]);
	dacdi_(& dascr_ .iscrda[idaa + 2], &c_b2414, & dascr_ .iscrda[idaa + 3])
		;
	dacop_(& dascr_ .iscrda[idaa + 3], & daele_ .asda[ih + 7]);
 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	dacop_(& daele_ .alda[ih - 1], & dascr_ .iscrda[idaa + 1]);
	dacop_(& daele_ .alda[ih + 1], & dascr_ .iscrda[idaa + 2]);
	damul_(& dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa + 2], &
		dascr_ .iscrda[idaa + 3]);
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dacad_(& dascr_ .iscrda[idaa + 3], &d__1, & dascr_ .iscrda[idaa + 4]);
	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 5]);
	damul_(& dascr_ .iscrda[idaa + 5], & dascr_ .iscrda[idaa + 4], &
		dascr_ .iscrda[idaa + 6]);
	dacdi_(& dascr_ .iscrda[idaa + 6], &c_b2414, & dascr_ .iscrda[idaa + 7])
		;
	dacop_(& dascr_ .iscrda[idaa + 7], & daele_ .asda[ih + 9]);
	++ih;
	if (ih > 2) {
	    ih = 1;
	}
 

 

	dascr_ .rscrri[idaa] = ell_ .ek[i__ - 1];
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dadic_(&dpd, &d__1, & dascr_ .iscrda[idaa + 1]);
	dacop_(& dascr_ .iscrda[idaa + 1], &aek);
	if (dare_(&aek) < 0.) {
 

	    dacmu_(&aek, &c_b2381, & dascr_ .iscrda[idaa]);
	    dacop_(& dascr_ .iscrda[idaa], &aek);
	}
 

	dafun_("SQRT  ", &aek, & dascr_ .iscrda[idaa], 6L);
	dacop_(& dascr_ .iscrda[idaa], &hi);
 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dacmu_(&hi, &d__1, & dascr_ .iscrda[idaa + 1]);
	dacop_(& dascr_ .iscrda[idaa + 1], &fi);
 

	dafun_("EXP   ", &fi, & dascr_ .iscrda[idaa], 6L);
	dacop_(& dascr_ .iscrda[idaa], &hp);
 

	dadic_(&hp, &c_b2366, & dascr_ .iscrda[idaa]);
	dacop_(& dascr_ .iscrda[idaa], &hm);
 

	daadd_(&hp, &hm, & dascr_ .iscrda[idaa]);
	dacmu_(& dascr_ .iscrda[idaa], &c_b461, & dascr_ .iscrda[idaa + 1]);
	dacop_(& dascr_ .iscrda[idaa + 1], &hc);
 

	dasub_(&hp, &hm, & dascr_ .iscrda[idaa]);
	dacmu_(& dascr_ .iscrda[idaa], &c_b461, & dascr_ .iscrda[idaa + 1]);
	dacop_(& dascr_ .iscrda[idaa + 1], &hs);
 

	dacop_(&hc, & daele_ .alda[ih - 1]);
 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	dascr_ .rscrri[99] = dascr_ .rscrri[idaa];
	dacon_(& daele_ .alda[ih + 1], & dascr_ .rscrri[99]);
 

	dadiv_(&hs, &hi, & dascr_ .iscrda[idaa]);
	dacop_(& dascr_ .iscrda[idaa], & daele_ .alda[ih + 1]);
 

	damul_(&hs, &hi, & dascr_ .iscrda[idaa]);
	dacop_(& dascr_ .iscrda[idaa], & daele_ .alda[ih + 3]);
 

	dacop_(&hc, & daele_ .alda[ih + 5]);
 

	dacop_(& daele_ .alda[ih + 1], & dascr_ .iscrda[idaa]);
	dacop_(& daele_ .alda[ih + 3], & dascr_ .iscrda[idaa + 1]);
	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 2]);
	damul_(& dascr_ .iscrda[idaa + 2], & dascr_ .iscrda[idaa], &
		dascr_ .iscrda[idaa + 3]);
	damul_(& dascr_ .iscrda[idaa + 3], & dascr_ .iscrda[idaa + 1], &
		dascr_ .iscrda[idaa + 4]);
	dacdi_(& dascr_ .iscrda[idaa + 4], &c_b2382, & dascr_ .iscrda[idaa + 5])
		;
	dacop_(& dascr_ .iscrda[idaa + 5], & daele_ .asda[ih + 5]);
 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	dacop_(& daele_ .alda[ih - 1], & dascr_ .iscrda[idaa + 1]);
	dacop_(& daele_ .alda[ih + 1], & dascr_ .iscrda[idaa + 2]);
	damul_(& dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa + 2], &
		dascr_ .iscrda[idaa + 3]);
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dasuc_(& dascr_ .iscrda[idaa + 3], &d__1, & dascr_ .iscrda[idaa + 4]);
	damul_(& daele_ .rv, & dascr_ .iscrda[idaa + 4], & dascr_ .iscrda[idaa + 
		5]);
	damul_(& dascr_ .iscrda[idaa + 5], &aek, & dascr_ .iscrda[idaa + 6]);
	dacdi_(& dascr_ .iscrda[idaa + 6], &c_b2414, & dascr_ .iscrda[idaa + 7])
		;
	dacop_(& dascr_ .iscrda[idaa + 7], & daele_ .asda[ih + 7]);
 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	dacop_(& daele_ .alda[ih - 1], & dascr_ .iscrda[idaa + 1]);
	dacop_(& daele_ .alda[ih + 1], & dascr_ .iscrda[idaa + 2]);
	damul_(& dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa + 2], &
		dascr_ .iscrda[idaa + 3]);
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dacad_(& dascr_ .iscrda[idaa + 3], &d__1, & dascr_ .iscrda[idaa + 4]);
	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 5]);
	damul_(& dascr_ .iscrda[idaa + 5], & dascr_ .iscrda[idaa + 4], &
		dascr_ .iscrda[idaa + 6]);
	dacdi_(& dascr_ .iscrda[idaa + 6], &c_b2414, & dascr_ .iscrda[idaa + 7])
		;
	dacop_(& dascr_ .iscrda[idaa + 7], & daele_ .asda[ih + 9]);
	goto L190;
 
L160:
	++ih;
 

	dafun_("EXP   ", &fi, & dascr_ .iscrda[idaa], 6L);
	dacop_(& dascr_ .iscrda[idaa], &hp);
 

	dadic_(&hp, &c_b2366, & dascr_ .iscrda[idaa]);
	dacop_(& dascr_ .iscrda[idaa], &hm);
 

	daadd_(&hp, &hm, & dascr_ .iscrda[idaa]);
	dacmu_(& dascr_ .iscrda[idaa], &c_b461, & dascr_ .iscrda[idaa + 1]);
	dacop_(& dascr_ .iscrda[idaa + 1], &hc);
 

	dasub_(&hp, &hm, & dascr_ .iscrda[idaa]);
	dacmu_(& dascr_ .iscrda[idaa], &c_b461, & dascr_ .iscrda[idaa + 1]);
	dacop_(& dascr_ .iscrda[idaa + 1], &hs);
 

	dacop_(&hc, & daele_ .alda[ih - 1]);
 

	dadiv_(&hs, &hi, & dascr_ .iscrda[idaa]);
	dacop_(& dascr_ .iscrda[idaa], & daele_ .alda[ih + 1]);
 

	damul_(&hs, &hi, & dascr_ .iscrda[idaa]);
	dacop_(& dascr_ .iscrda[idaa], & daele_ .alda[ih + 3]);
 

	dacop_(&hc, & daele_ .alda[ih + 5]);
 

	dasuc_(&hc, &c_b2366, & dascr_ .iscrda[idaa]);
	dadiv_(&wf, &afok, & dascr_ .iscrda[idaa + 1]);
	damul_(& dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa], &
		dascr_ .iscrda[idaa + 2]);
	dadiv_(& dascr_ .iscrda[idaa + 2], &dpsq, & dascr_ .iscrda[idaa + 3]);
	dacop_(& dascr_ .iscrda[idaa + 3], &wfa);
 

	dadiv_(&wf, &hi, & dascr_ .iscrda[idaa]);
	damul_(& dascr_ .iscrda[idaa], &hs, & dascr_ .iscrda[idaa + 1]);
	dadiv_(& dascr_ .iscrda[idaa + 1], &dpsq, & dascr_ .iscrda[idaa + 2]);
	dacop_(& dascr_ .iscrda[idaa + 2], &wfhi);
 

	damul_(&wfa, & daele_ .dpda, & dascr_ .iscrda[idaa]);
	dacmu_(& dascr_ .iscrda[idaa], &c_b2384, & dascr_ .iscrda[idaa + 1]);
	dacop_(& dascr_ .iscrda[idaa + 1], & daele_ .alda[ih + 7]);
 

	dacmu_(&wfhi, &c_b2381, & dascr_ .iscrda[idaa]);
	damul_(& dascr_ .iscrda[idaa], & daele_ .dpda, & dascr_ .iscrda[idaa + 1]
		);
	dacmu_(& dascr_ .iscrda[idaa + 1], &c_b2384, & dascr_ .iscrda[idaa + 2])
		;
	dacop_(& dascr_ .iscrda[idaa + 2], & daele_ .alda[ih + 9]);
 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	dacop_(& daele_ .alda[ih - 1], & dascr_ .iscrda[idaa + 1]);
	dacop_(& daele_ .alda[ih + 1], & dascr_ .iscrda[idaa + 2]);
	damul_(& dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa + 2], &
		dascr_ .iscrda[idaa + 3]);
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dasuc_(& dascr_ .iscrda[idaa + 3], &d__1, & dascr_ .iscrda[idaa + 4]);
	dacop_(& dascr_ .iscrda[idaa + 4], &sm12);
 

	dacop_(& daele_ .alda[ih + 1], & dascr_ .iscrda[idaa]);
	dacop_(& daele_ .alda[ih + 3], & dascr_ .iscrda[idaa + 1]);
	damul_(& dascr_ .iscrda[idaa], & dascr_ .iscrda[idaa + 1], &
		dascr_ .iscrda[idaa + 2]);
	dacop_(& dascr_ .iscrda[idaa + 2], &sm23);
 

 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	dacop_(& daele_ .alda[ih + 1], & dascr_ .iscrda[idaa + 1]);
	dacmu_(&dpd, &c_b2415, & dascr_ .iscrda[idaa + 2]);
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dasuc_(& dascr_ .iscrda[idaa + 1], &d__1, & dascr_ .iscrda[idaa + 3]);
	damul_(& daele_ .dpda, & daele_ .dpda, & dascr_ .iscrda[idaa + 4]);
	dadiv_(& dascr_ .iscrda[idaa + 4], & dascr_ .iscrda[idaa + 2], &
		dascr_ .iscrda[idaa + 5]);
	damul_(& dascr_ .iscrda[idaa + 5], &sm12, & dascr_ .iscrda[idaa + 6]);
	damul_(& daele_ .dpda, & dascr_ .iscrda[idaa + 3], & dascr_ .iscrda[idaa 
		+ 7]);
	daadd_(& dascr_ .iscrda[idaa + 6], & dascr_ .iscrda[idaa + 7], &
		dascr_ .iscrda[idaa + 8]);
	dasuc_(& daele_ .rv, &c_b2366, & dascr_ .iscrda[idaa + 9]);
	dascr_ .rscrri[idaa + 10] = ell_ .el[i__ - 1];
	damul_(& daele_ .rv, & dascr_ .iscrda[idaa + 8], & dascr_ .iscrda[idaa + 
		11]);
	dadiv_(& dascr_ .iscrda[idaa + 11], &afok, & dascr_ .iscrda[idaa + 12]);
	damul_(& dascr_ .iscrda[idaa + 12], &wf, & dascr_ .iscrda[idaa + 13]);
	damul_(& dascr_ .iscrda[idaa + 13], &wf, & dascr_ .iscrda[idaa + 14]);
	d__1 = dascr_ .rscrri[idaa + 10] * 1.;
	dacmu_(& dascr_ .iscrda[idaa + 9], &d__1, & dascr_ .iscrda[idaa + 15]);
	daadd_(& dascr_ .iscrda[idaa + 14], & dascr_ .iscrda[idaa + 15], &
		dascr_ .iscrda[idaa + 16]);
	dacmu_(& dascr_ .iscrda[idaa + 16], &c_b2384, & dascr_ .iscrda[idaa + 
		17]);
	dacop_(& dascr_ .iscrda[idaa + 17], & daele_ .asda[ih - 1]);
 

	dacmu_(&dpsq, &c_b2400, & dascr_ .iscrda[idaa]);
	damul_(& daele_ .dpda, &wf, & dascr_ .iscrda[idaa + 1]);
	dadiv_(& dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa], &
		dascr_ .iscrda[idaa + 2]);
	damul_(& dascr_ .iscrda[idaa + 2], &sm12, & dascr_ .iscrda[idaa + 3]);
	damul_(&dpd, &wfhi, & dascr_ .iscrda[idaa + 4]);
	dasub_(& dascr_ .iscrda[idaa + 3], & dascr_ .iscrda[idaa + 4], &
		dascr_ .iscrda[idaa + 5]);
	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 6]);
	damul_(& dascr_ .iscrda[idaa + 6], & dascr_ .iscrda[idaa + 5], &
		dascr_ .iscrda[idaa + 7]);
	dacop_(& dascr_ .iscrda[idaa + 7], & daele_ .asda[ih + 1]);
 

	dascr_ .rscrri[idaa] = ell_ .ed[i__ - 1];
	dacmu_(& daele_ .dpda, &c_b461, & dascr_ .iscrda[idaa + 1]);
	dadiv_(& dascr_ .iscrda[idaa + 1], &afok, & dascr_ .iscrda[idaa + 2]);
	dadiv_(& dascr_ .iscrda[idaa + 2], &dpd, & dascr_ .iscrda[idaa + 3]);
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dacmu_(& dascr_ .iscrda[idaa + 3], &d__1, & dascr_ .iscrda[idaa + 4]);
	damul_(& dascr_ .iscrda[idaa + 4], &sm23, & dascr_ .iscrda[idaa + 5]);
	damul_(&dpd, &wfa, & dascr_ .iscrda[idaa + 6]);
	dasub_(& dascr_ .iscrda[idaa + 5], & dascr_ .iscrda[idaa + 6], &
		dascr_ .iscrda[idaa + 7]);
	damul_(& daele_ .rv, & dascr_ .iscrda[idaa + 7], & dascr_ .iscrda[idaa + 
		8]);
	dacop_(& dascr_ .iscrda[idaa + 8], & daele_ .asda[ih + 3]);
 

	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa]);
	damul_(& dascr_ .iscrda[idaa], &sm23, & dascr_ .iscrda[idaa + 1]);
	dacdi_(& dascr_ .iscrda[idaa + 1], &c_b2382, & dascr_ .iscrda[idaa + 2])
		;
	dacop_(& dascr_ .iscrda[idaa + 2], & daele_ .asda[ih + 5]);
 

	damul_(& daele_ .rv, &sm12, & dascr_ .iscrda[idaa]);
	damul_(& dascr_ .iscrda[idaa], &afok, & dascr_ .iscrda[idaa + 1]);
	dacdi_(& dascr_ .iscrda[idaa + 1], &c_b2414, & dascr_ .iscrda[idaa + 2])
		;
	dacop_(& dascr_ .iscrda[idaa + 2], & daele_ .asda[ih + 7]);
 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	dacop_(& daele_ .alda[ih - 1], & dascr_ .iscrda[idaa + 1]);
	dacop_(& daele_ .alda[ih + 1], & dascr_ .iscrda[idaa + 2]);
	damul_(& dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa + 2], &
		dascr_ .iscrda[idaa + 3]);
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dacad_(& dascr_ .iscrda[idaa + 3], &d__1, & dascr_ .iscrda[idaa + 4]);
	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 5]);
	damul_(& dascr_ .iscrda[idaa + 5], & dascr_ .iscrda[idaa + 4], &
		dascr_ .iscrda[idaa + 6]);
	dacdi_(& dascr_ .iscrda[idaa + 6], &c_b2414, & dascr_ .iscrda[idaa + 7])
		;
	dacop_(& dascr_ .iscrda[idaa + 7], & daele_ .asda[ih + 9]);
	++ih;
	if (ih > 2) {
	    ih = 1;
	}
 

 

	dascr_ .rscrri[idaa] = ell_ .ek[i__ - 1];
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dadic_(&dpd, &d__1, & dascr_ .iscrda[idaa + 1]);
	dacop_(& dascr_ .iscrda[idaa + 1], &aek);
	if (dare_(&aek) < 0.) {
 

	    dacmu_(&aek, &c_b2381, & dascr_ .iscrda[idaa]);
	    dacop_(& dascr_ .iscrda[idaa], &aek);
	}
 

	dafun_("SQRT  ", &aek, & dascr_ .iscrda[idaa], 6L);
	dacop_(& dascr_ .iscrda[idaa], &hi);
 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dacmu_(&hi, &d__1, & dascr_ .iscrda[idaa + 1]);
	dacop_(& dascr_ .iscrda[idaa + 1], &fi);
 

	dafun_("SIN   ", &fi, & dascr_ .iscrda[idaa], 6L);
	dacop_(& dascr_ .iscrda[idaa], &si);
 

	dafun_("COS   ", &fi, & dascr_ .iscrda[idaa], 6L);
	dacop_(& dascr_ .iscrda[idaa], &co);
 

	dacop_(&co, & daele_ .alda[ih - 1]);
 

	dadiv_(&si, &hi, & dascr_ .iscrda[idaa]);
	dacop_(& dascr_ .iscrda[idaa], & daele_ .alda[ih + 1]);
 

	dacmu_(&si, &c_b2381, & dascr_ .iscrda[idaa]);
	damul_(& dascr_ .iscrda[idaa], &hi, & dascr_ .iscrda[idaa + 1]);
	dacop_(& dascr_ .iscrda[idaa + 1], & daele_ .alda[ih + 3]);
 

	dacop_(&co, & daele_ .alda[ih + 5]);
 

	dacop_(& daele_ .alda[ih + 1], & dascr_ .iscrda[idaa]);
	dacop_(& daele_ .alda[ih + 3], & dascr_ .iscrda[idaa + 1]);
	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 2]);
	damul_(& dascr_ .iscrda[idaa + 2], & dascr_ .iscrda[idaa], &
		dascr_ .iscrda[idaa + 3]);
	damul_(& dascr_ .iscrda[idaa + 3], & dascr_ .iscrda[idaa + 1], &
		dascr_ .iscrda[idaa + 4]);
	dacdi_(& dascr_ .iscrda[idaa + 4], &c_b2382, & dascr_ .iscrda[idaa + 5])
		;
	dacop_(& dascr_ .iscrda[idaa + 5], & daele_ .asda[ih + 5]);
 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	dacop_(& daele_ .alda[ih - 1], & dascr_ .iscrda[idaa + 1]);
	dacop_(& daele_ .alda[ih + 1], & dascr_ .iscrda[idaa + 2]);
	damul_(& dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa + 2], &
		dascr_ .iscrda[idaa + 3]);
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dasuc_(& dascr_ .iscrda[idaa + 3], &d__1, & dascr_ .iscrda[idaa + 4]);
	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 5]);
	damul_(& dascr_ .iscrda[idaa + 5], & dascr_ .iscrda[idaa + 4], &
		dascr_ .iscrda[idaa + 6]);
	damul_(& dascr_ .iscrda[idaa + 6], &aek, & dascr_ .iscrda[idaa + 7]);
	dacdi_(& dascr_ .iscrda[idaa + 7], &c_b2414, & dascr_ .iscrda[idaa + 8])
		;
	dacop_(& dascr_ .iscrda[idaa + 8], & daele_ .asda[ih + 7]);
 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	dacop_(& daele_ .alda[ih - 1], & dascr_ .iscrda[idaa + 1]);
	dacop_(& daele_ .alda[ih + 1], & dascr_ .iscrda[idaa + 2]);
	damul_(& dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa + 2], &
		dascr_ .iscrda[idaa + 3]);
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dacad_(& dascr_ .iscrda[idaa + 3], &d__1, & dascr_ .iscrda[idaa + 4]);
	dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 5]);
	damul_(& dascr_ .iscrda[idaa + 5], & dascr_ .iscrda[idaa + 4], &
		dascr_ .iscrda[idaa + 6]);
	dacdi_(& dascr_ .iscrda[idaa + 6], &c_b2414, & dascr_ .iscrda[idaa + 7])
		;
	dacop_(& dascr_ .iscrda[idaa + 7], & daele_ .asda[ih + 9]);
	goto L190;
 

 
 

L170:
	ih = 1;
 

	dascr_ .rscrri[idaa] = ell_ .ek[i__ - 1];
	dascr_ .rscrri[idaa + 1] = dascr_ .rscrri[idaa] * -1.;
	dascr_ .rscrri[99] = dascr_ .rscrri[idaa + 1];
	dacon_(&fokq, & dascr_ .rscrri[99]);
	goto L140;
 

 
 

L180:
 

	dascr_ .rscrri[idaa] = ell_ .ed[i__ - 1];
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dadic_(&dpsq, &d__1, & dascr_ .iscrda[idaa + 1]);
	dacop_(& dascr_ .iscrda[idaa + 1], &rhoi);
 

	dascr_ .rscrri[idaa] = ell_ .el[i__ - 1];
	dascr_ .rscrri[idaa + 1] = ell_ .el[i__ - 1];
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dacmu_(&rhoi, &d__1, & dascr_ .iscrda[idaa + 2]);
	dacmu_(& dascr_ .iscrda[idaa + 2], &c_b461, & dascr_ .iscrda[idaa + 3]);
	d__1 = dascr_ .rscrri[idaa + 1] * 1.;
	dacmu_(&rhoi, &d__1, & dascr_ .iscrda[idaa + 4]);
	dacmu_(& dascr_ .iscrda[idaa + 4], &c_b461, & dascr_ .iscrda[idaa + 5]);
	dafun_("SIN   ", & dascr_ .iscrda[idaa + 3], & dascr_ .iscrda[idaa + 6],
		 6L);
	dafun_("COS   ", & dascr_ .iscrda[idaa + 5], & dascr_ .iscrda[idaa + 7],
		 6L);
	damul_(&rhoi, & dascr_ .iscrda[idaa + 6], & dascr_ .iscrda[idaa + 8]);
	dadiv_(& dascr_ .iscrda[idaa + 8], & dascr_ .iscrda[idaa + 7], &
		dascr_ .iscrda[idaa + 9]);
	dacop_(& dascr_ .iscrda[idaa + 9], &fok);
 

	dascr_ .rscrri[99] = 1.;
	dacon_(daele_ .alda, & dascr_ .rscrri[99]);
 

	dascr_ .rscrri[99] = 0.;
	dacon_(& daele_ .alda[2], & dascr_ .rscrri[99]);
 

	dacop_(&fok, & daele_ .alda[4]);
 

	dascr_ .rscrri[99] = 1.;
	dacon_(& daele_ .alda[6], & dascr_ .rscrri[99]);
 

	dascr_ .rscrri[99] = 1.;
	dacon_(& daele_ .alda[1], & dascr_ .rscrri[99]);
 

	dascr_ .rscrri[99] = 0.;
	dacon_(& daele_ .alda[3], & dascr_ .rscrri[99]);
 

	dacmu_(&fok, &c_b2381, & dascr_ .iscrda[idaa]);
	dacop_(& dascr_ .iscrda[idaa], & daele_ .alda[5]);
 

	dascr_ .rscrri[99] = 1.;
	dacon_(& daele_ .alda[7], & dascr_ .rscrri[99]);
	goto L190;
 

 
 

L190:
	for (ih = 1; ih <= 2; ++ih) {
	    for (ip = 1; ip <= 6; ++ip) {
		i__2 = dial_ .nord + 1;
		for (ien = 1; ien <= i__2; ++ien) {
		    if (dial_ .nvar2 == 5) {
			dapri6_(& daele_ .alda[ih + (ip << 1) - 3], &result, &
				ien, &c__5);
			dael6_ .ald6[i__ + (ih + (ip + ien * 6 << 1)) * 700 - 
				10501] = result;
			dapri6_(& daele_ .asda[ih + (ip << 1) - 3], &result, &
				ien, &c__5);
			dael6_ .asd6[i__ + (ih + (ip + ien * 6 << 1)) * 700 - 
				10501] = result;
		    } else if (dial_ .nvar2 == 6) {
			dapri6_(& daele_ .alda[ih + (ip << 1) - 3], &result, &
				ien, &c__6);
			dael6_ .ald6[i__ + (ih + (ip + ien * 6 << 1)) * 700 - 
				10501] = result;
			dapri6_(& daele_ .asda[ih + (ip << 1) - 3], &result, &
				ien, &c__6);
			dael6_ .asd6[i__ + (ih + (ip + ien * 6 << 1)) * 700 - 
				10501] = result;
		    }
 
		}
 
	    }
	}
 
    }
    if ((dial_ .idalloc == 2 || dial_ .idalloc == 3) && *ix == tra1_ .numl * 
	    syn_ .ncy) {
	dadal_(&wfa, &c__1);
	dadal_(&rhoi, &c__1);
	dadal_(&afok, &c__1);
	dadal_(&wf, &c__1);
	dadal_(&fokc, &c__1);
	dadal_(&hs, &c__1);
	dadal_(&hc, &c__1);
	dadal_(&hm, &c__1);
	dadal_(&hp, &c__1);
	dadal_(&hi1, &c__1);
	dadal_(&aek, &c__1);
	dadal_(&fi, &c__1);
	dadal_(&hi, &c__1);
	dadal_(&rhoc, &c__1);
	dadal_(&siq, &c__1);
	dadal_(&gl, &c__1);
	dadal_(&g, &c__1);
	dadal_(&co, &c__1);
	dadal_(&si, &c__1);
	dadal_(&as6, &c__1);
	dadal_(&as4, &c__1);
	dadal_(&as3, &c__1);
	dadal_(&sm23, &c__1);
	dadal_(&sm12, &c__1);
	dadal_(&sm6, &c__1);
	dadal_(&sm5, &c__1);
	dadal_(&sm4, &c__1);
	dadal_(&sm3, &c__1);
	dadal_(&sm2, &c__1);
	dadal_(&sm1, &c__1);
	dadal_(&fok1, &c__1);
	dadal_(&rho, &c__1);
	dadal_(&fok, &c__1);
	dadal_(&dpsq, &c__1);
	dadal_(&dpd, &c__1);
	dadal_(&wfhi, &c__1);
	dadal_(&fokq, &c__1);
 
    }
    return 0;
}  

 
 
  int envar_(dpp)
doublereal *dpp;
{
     
    integer i__1;
    doublereal d__1;

     
    double sqrt(), sin(), cos(), tan(), exp();

     
    static doublereal g;
    static integer i__, l;
    static doublereal hc;
    static integer ih;
    static doublereal si, co, gl, hi, fi, hp, hm, hs, wf, hi1;
    static integer kz1;
    static doublereal dpd, fok, dpsq, rho, fokq, afok, rhoi;
    extern   int block_();

 

 
 

 

    dpd = *dpp + 1.;
    dpsq = sqrt(dpd);
    i__1 = str_ .il;
    for (i__ = 1; i__ <= i__1; ++i__) {
	if ((d__1 = ell_ .el[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    goto L190;
	}
	kz1 = ell_ .kz[i__ - 1] + 1;
	switch ((int)kz1) {
	    case 1:  goto L10;
	    case 2:  goto L30;
	    case 3:  goto L90;
	    case 4:  goto L50;
	    case 5:  goto L70;
	    case 6:  goto L80;
	    case 7:  goto L120;
	    case 8:  goto L170;
	    case 9:  goto L180;
	}
 

 
 

L10:
	for (l = 1; l <= 2; ++l) {
	    mat_ .a[i__ + (l + 2) * 700 - 2101] = 1.;
	    mat_ .a[i__ + (l + 4) * 700 - 2101] = ell_ .el[i__ - 1];
	    mat_ .a[i__ + (l + 6) * 700 - 2101] = 0.;
 
	    mat_ .a[i__ + (l + 8) * 700 - 2101] = 1.;
	}
	goto L200;
 

 
 
 

L30:
	ih = 1;
L40:
	fok = ell_ .el[i__ - 1] * ell_ .ed[i__ - 1] / dpsq;
	if ((( fok ) >= 0 ? ( fok ) : -( fok ))  <= 1e-17) {
	    goto L10;
	}
	rho = 1. / ell_ .ed[i__ - 1] * dpsq;
	si = sin(fok);
	co = cos(fok);
	mat_ .a[i__ + (ih + 2) * 700 - 2101] = 1.;
	mat_ .a[i__ + (ih + 4) * 700 - 2101] = rho * si;
	mat_ .a[i__ + (ih + 6) * 700 - 2101] = 0.;
	mat_ .a[i__ + (ih + 8) * 700 - 2101] = 1.;
	mat_ .a[i__ + (ih + 10) * 700 - 2101] = -rho * (1. - co) / dpsq;
	mat_ .a[i__ + (ih + 12) * 700 - 2101] = tan(fok * .5) * -2. / dpsq;
 
	++ih;
	if (ih > 2) {
	    ih = 1;
	}
	g = tan(fok * .5) / rho;
	gl = ell_ .el[i__ - 1] * g;
	mat_ .a[i__ + (ih + 2) * 700 - 2101] = 1. - gl;
	mat_ .a[i__ + (ih + 4) * 700 - 2101] = ell_ .el[i__ - 1];
	mat_ .a[i__ + (ih + 6) * 700 - 2101] = -g * (2. - gl);
	mat_ .a[i__ + (ih + 8) * 700 - 2101] = mat_ .a[i__ + (ih + 2) * 700 - 
		2101];
	goto L200;
 

 
 
 

L50:
	ih = 1;
L60:
	fok = ell_ .el[i__ - 1] * ell_ .ed[i__ - 1] / dpsq;
	if ((( fok ) >= 0 ? ( fok ) : -( fok ))  <= 1e-17) {
	    goto L10;
	}
	rho = 1. / ell_ .ed[i__ - 1] * dpsq;
	si = sin(fok);
	co = cos(fok);
	mat_ .a[i__ + (ih + 2) * 700 - 2101] = co;
	mat_ .a[i__ + (ih + 4) * 700 - 2101] = rho * si;
	mat_ .a[i__ + (ih + 6) * 700 - 2101] = -si / rho;
	mat_ .a[i__ + (ih + 8) * 700 - 2101] = co;
	mat_ .a[i__ + (ih + 10) * 700 - 2101] = -rho * (1. - co) / dpsq;
	mat_ .a[i__ + (ih + 12) * 700 - 2101] = -si / dpsq;
 
	++ih;
	if (ih > 2) {
	    ih = 1;
	}
	mat_ .a[i__ + (ih + 2) * 700 - 2101] = 1.;
	mat_ .a[i__ + (ih + 4) * 700 - 2101] = ell_ .el[i__ - 1];
	mat_ .a[i__ + (ih + 6) * 700 - 2101] = 0.;
	mat_ .a[i__ + (ih + 8) * 700 - 2101] = 1.;
	goto L200;
 

 
 

L70:
	ih = 2;
	goto L40;
 

 
 

L80:
	ih = 2;
	goto L60;
 

 
 
 

L90:
	fok = ell_ .ek[i__ - 1] / (*dpp + 1.);
	if ((( fok ) >= 0 ? ( fok ) : -( fok ))  <= 1e-17) {
	    goto L10;
	}
	ih = 0;
	hi = sqrt(((( fok ) >= 0 ? ( fok ) : -( fok )) ));
	fi = ell_ .el[i__ - 1] * hi;
	if (fok > 0.) {
	    goto L110;
	}
L100:
	++ih;
	mat_ .a[i__ + (ih + 2) * 700 - 2101] = cos(fi);
	hi1 = sin(fi);
	mat_ .a[i__ + (ih + 4) * 700 - 2101] = hi1 / hi;
	mat_ .a[i__ + (ih + 6) * 700 - 2101] = -hi1 * hi;
	mat_ .a[i__ + (ih + 8) * 700 - 2101] = mat_ .a[i__ + (ih + 2) * 700 - 
		2101];
	if (ih == 2) {
	    goto L200;
	}
 
L110:
	++ih;
	hp = exp(fi);
	hm = 1. / hp;
	hc = (hp + hm) * .5;
	hs = (hp - hm) * .5;
	mat_ .a[i__ + (ih + 2) * 700 - 2101] = hc;
	mat_ .a[i__ + (ih + 4) * 700 - 2101] = hs / hi;
	mat_ .a[i__ + (ih + 6) * 700 - 2101] = hs * hi;
	mat_ .a[i__ + (ih + 8) * 700 - 2101] = hc;
	if (ih == 1) {
	    goto L100;
	}
	goto L200;
 

 
 
 

L120:
	ih = 0;
	fokq = ell_ .ek[i__ - 1];
L130:
	wf = ell_ .ed[i__ - 1] / dpsq;
	fok = fokq / dpd - wf * wf;
	if ((( fok ) >= 0 ? ( fok ) : -( fok ))  <= 1e-17) {
	    goto L10;
	}
	afok = (( fok ) >= 0 ? ( fok ) : -( fok )) ;
	hi = sqrt(afok);
	fi = hi * ell_ .el[i__ - 1];
	if (fok > 0.) {
	    goto L160;
	}
 
	++ih;
	si = sin(fi);
	co = cos(fi);
	mat_ .a[i__ + (ih + 2) * 700 - 2101] = co;
	mat_ .a[i__ + (ih + 4) * 700 - 2101] = si / hi;
	mat_ .a[i__ + (ih + 6) * 700 - 2101] = -si * hi;
	mat_ .a[i__ + (ih + 8) * 700 - 2101] = co;
	mat_ .a[i__ + (ih + 10) * 700 - 2101] = -wf / afok * (1. - co) / dpsq;
	mat_ .a[i__ + (ih + 12) * 700 - 2101] = -wf / hi * si / dpsq;
	++ih;
	if (ih > 2) {
	    ih = 1;
	}
	hi = sqrt((d__1 = ell_ .ek[i__ - 1] / dpd, (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ));
	fi = hi * ell_ .el[i__ - 1];
	hp = exp(fi);
	hm = 1. / hp;
	hc = (hp + hm) * .5;
	hs = (hp - hm) * .5;
	mat_ .a[i__ + (ih + 2) * 700 - 2101] = hc;
	mat_ .a[i__ + (ih + 4) * 700 - 2101] = ell_ .el[i__ - 1];
	if ((( hi ) >= 0 ? ( hi ) : -( hi ))  <= 1e-17) {
	    goto L150;
	}
	mat_ .a[i__ + (ih + 4) * 700 - 2101] = hs / hi;
L150:
	mat_ .a[i__ + (ih + 6) * 700 - 2101] = hs * hi;
	mat_ .a[i__ + (ih + 8) * 700 - 2101] = hc;
	goto L200;
 
L160:
	++ih;
	hp = exp(fi);
	hm = 1. / hp;
	hc = (hp + hm) * .5;
	hs = (hp - hm) * .5;
	mat_ .a[i__ + (ih + 2) * 700 - 2101] = hc;
	mat_ .a[i__ + (ih + 4) * 700 - 2101] = hs / hi;
	mat_ .a[i__ + (ih + 6) * 700 - 2101] = hs * hi;
	mat_ .a[i__ + (ih + 8) * 700 - 2101] = hc;
	mat_ .a[i__ + (ih + 10) * 700 - 2101] = wf / afok * (1. - hc) / dpsq;
	mat_ .a[i__ + (ih + 12) * 700 - 2101] = -wf / hi * hs / dpsq;
	++ih;
	if (ih > 2) {
	    ih = 1;
	}
	hi = sqrt((d__1 = ell_ .ek[i__ - 1] / dpd, (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ));
	fi = hi * ell_ .el[i__ - 1];
	si = sin(fi);
	co = cos(fi);
	mat_ .a[i__ + (ih + 2) * 700 - 2101] = co;
	mat_ .a[i__ + (ih + 4) * 700 - 2101] = si / hi;
	mat_ .a[i__ + (ih + 6) * 700 - 2101] = -si * hi;
	mat_ .a[i__ + (ih + 8) * 700 - 2101] = co;
	goto L200;
 

 
 

L170:
	ih = 1;
	fokq = - ell_ .ek[i__ - 1];
	goto L130;
 

 
 

L180:
	rhoi = ell_ .ed[i__ - 1] / dpsq;
	fok = rhoi * tan(ell_ .el[i__ - 1] * rhoi * .5);
	mat_ .a[i__ - 1] = 1.;
	mat_ .a[i__ + 1399] = 0.;
	mat_ .a[i__ + 2799] = fok;
	mat_ .a[i__ + 4199] = 1.;
	mat_ .a[i__ + 699] = 1.;
	mat_ .a[i__ + 2099] = 0.;
	mat_ .a[i__ + 3499] = -fok;
	mat_ .a[i__ + 4899] = 1.;
	goto L200;
 

 
 

L190:
	ell_ .sm[i__ - 1] = ell_ .ed[i__ - 1];
L200:
	;
    }
    block_();
    return 0;
}  

 
 
  int envardis_(dpp, aeg, bl1eg, bl2eg)
doublereal *dpp, *aeg, *bl1eg, *bl2eg;
{
     
    integer i__1;
    doublereal d__1;

     
    double sqrt(), sin(), cos(), tan(), exp();

     
    extern   int blockdis_();
    static doublereal g;
    static integer i__, l;
    static doublereal hc;
    static integer ih;
    static doublereal si, co, gl, hi, fi, hp, hm, hs, wf, hi1;
    static integer kz1;
    static doublereal dpd, dpsq, fok, rho, fokq, afok, rhoi;

 

 
 

 

     
    bl2eg -= 901;
    bl1eg -= 901;
    aeg -= 2101;

     
    dpd = *dpp + 1.;
    dpsq = sqrt(dpd);
    i__1 = str_ .il;
    for (i__ = 1; i__ <= i__1; ++i__) {
	if ((d__1 = ell_ .el[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    goto L190;
	}
	kz1 = ell_ .kz[i__ - 1] + 1;
	switch ((int)kz1) {
	    case 1:  goto L10;
	    case 2:  goto L30;
	    case 3:  goto L90;
	    case 4:  goto L50;
	    case 5:  goto L70;
	    case 6:  goto L80;
	    case 7:  goto L120;
	    case 8:  goto L170;
	    case 9:  goto L180;
	}
 

 
 

L10:
	for (l = 1; l <= 2; ++l) {
	    aeg[i__ + (l + 2) * 700] = 1.;
	    aeg[i__ + (l + 4) * 700] = ell_ .el[i__ - 1];
	    aeg[i__ + (l + 6) * 700] = 0.;
 
	    aeg[i__ + (l + 8) * 700] = 1.;
	}
	goto L190;
 

 
 
 

L30:
	ih = 1;
L40:
	fok = ell_ .el[i__ - 1] * ell_ .ed[i__ - 1] / dpsq;
	if ((( fok ) >= 0 ? ( fok ) : -( fok ))  <= 1e-17) {
	    goto L10;
	}
	rho = 1. / ell_ .ed[i__ - 1] * dpsq;
	si = sin(fok);
	co = cos(fok);
	aeg[i__ + (ih + 2) * 700] = 1.;
	aeg[i__ + (ih + 4) * 700] = rho * si;
	aeg[i__ + (ih + 6) * 700] = 0.;
	aeg[i__ + (ih + 8) * 700] = 1.;
	aeg[i__ + (ih + 10) * 700] = -rho * (1. - co) / dpsq;
	aeg[i__ + (ih + 12) * 700] = tan(fok * .5) * -2. / dpsq;
 
	++ih;
	if (ih > 2) {
	    ih = 1;
	}
	g = tan(fok * .5) / rho;
	gl = ell_ .el[i__ - 1] * g;
	aeg[i__ + (ih + 2) * 700] = 1. - gl;
	aeg[i__ + (ih + 4) * 700] = ell_ .el[i__ - 1];
	aeg[i__ + (ih + 6) * 700] = -g * (2. - gl);
	aeg[i__ + (ih + 8) * 700] = aeg[i__ + (ih + 2) * 700];
	goto L190;
 

 
 
 

L50:
	ih = 1;
L60:
	fok = ell_ .el[i__ - 1] * ell_ .ed[i__ - 1] / dpsq;
	if ((( fok ) >= 0 ? ( fok ) : -( fok ))  <= 1e-17) {
	    goto L10;
	}
	rho = 1. / ell_ .ed[i__ - 1] * dpsq;
	si = sin(fok);
	co = cos(fok);
	aeg[i__ + (ih + 2) * 700] = co;
	aeg[i__ + (ih + 4) * 700] = rho * si;
	aeg[i__ + (ih + 6) * 700] = -si / rho;
	aeg[i__ + (ih + 8) * 700] = co;
	aeg[i__ + (ih + 10) * 700] = -rho * (1. - co) / dpsq;
	aeg[i__ + (ih + 12) * 700] = -si / dpsq;
 
	++ih;
	if (ih > 2) {
	    ih = 1;
	}
	aeg[i__ + (ih + 2) * 700] = 1.;
	aeg[i__ + (ih + 4) * 700] = ell_ .el[i__ - 1];
	aeg[i__ + (ih + 6) * 700] = 0.;
	aeg[i__ + (ih + 8) * 700] = 1.;
	goto L190;
 

 
 

L70:
	ih = 2;
	goto L40;
 

 
 

L80:
	ih = 2;
	goto L60;
 

 
 
 

L90:
	fok = ell_ .ek[i__ - 1] / (*dpp + 1.);
	if ((( fok ) >= 0 ? ( fok ) : -( fok ))  <= 1e-17) {
	    goto L10;
	}
	ih = 0;
	hi = sqrt(((( fok ) >= 0 ? ( fok ) : -( fok )) ));
	fi = ell_ .el[i__ - 1] * hi;
	if (fok > 0.) {
	    goto L110;
	}
L100:
	++ih;
	aeg[i__ + (ih + 2) * 700] = cos(fi);
	hi1 = sin(fi);
	aeg[i__ + (ih + 4) * 700] = hi1 / hi;
	aeg[i__ + (ih + 6) * 700] = -hi1 * hi;
	aeg[i__ + (ih + 8) * 700] = aeg[i__ + (ih + 2) * 700];
	if (ih == 2) {
	    goto L190;
	}
 
L110:
	++ih;
	hp = exp(fi);
	hm = 1. / hp;
	hc = (hp + hm) * .5;
	hs = (hp - hm) * .5;
	aeg[i__ + (ih + 2) * 700] = hc;
	aeg[i__ + (ih + 4) * 700] = hs / hi;
	aeg[i__ + (ih + 6) * 700] = hs * hi;
	aeg[i__ + (ih + 8) * 700] = hc;
	if (ih == 1) {
	    goto L100;
	}
	goto L190;
 

 
 
 

L120:
	ih = 0;
	fokq = ell_ .ek[i__ - 1];
L130:
	wf = ell_ .ed[i__ - 1] / dpsq;
	fok = fokq / dpd - wf * wf;
	if ((( fok ) >= 0 ? ( fok ) : -( fok ))  <= 1e-17) {
	    goto L10;
	}
	afok = (( fok ) >= 0 ? ( fok ) : -( fok )) ;
	hi = sqrt(afok);
	fi = hi * ell_ .el[i__ - 1];
	if (fok > 0.) {
	    goto L160;
	}
 
	++ih;
	si = sin(fi);
	co = cos(fi);
	aeg[i__ + (ih + 2) * 700] = co;
	aeg[i__ + (ih + 4) * 700] = si / hi;
	aeg[i__ + (ih + 6) * 700] = -si * hi;
	aeg[i__ + (ih + 8) * 700] = co;
	aeg[i__ + (ih + 10) * 700] = -wf / afok * (1. - co) / dpsq;
	aeg[i__ + (ih + 12) * 700] = -wf / hi * si / dpsq;
	++ih;
	if (ih > 2) {
	    ih = 1;
	}
	hi = sqrt((d__1 = ell_ .ek[i__ - 1] / dpd, (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ));
	fi = hi * ell_ .el[i__ - 1];
	hp = exp(fi);
	hm = 1. / hp;
	hc = (hp + hm) * .5;
	hs = (hp - hm) * .5;
	aeg[i__ + (ih + 2) * 700] = hc;
	aeg[i__ + (ih + 4) * 700] = ell_ .el[i__ - 1];
	if ((( hi ) >= 0 ? ( hi ) : -( hi ))  <= 1e-17) {
	    goto L150;
	}
	aeg[i__ + (ih + 4) * 700] = hs / hi;
L150:
	aeg[i__ + (ih + 6) * 700] = hs * hi;
	aeg[i__ + (ih + 8) * 700] = hc;
	goto L190;
 
L160:
	++ih;
	hp = exp(fi);
	hm = 1. / hp;
	hc = (hp + hm) * .5;
	hs = (hp - hm) * .5;
	aeg[i__ + (ih + 2) * 700] = hc;
	aeg[i__ + (ih + 4) * 700] = hs / hi;
	aeg[i__ + (ih + 6) * 700] = hs * hi;
	aeg[i__ + (ih + 8) * 700] = hc;
	aeg[i__ + (ih + 10) * 700] = wf / afok * (1. - hc) / dpsq;
	aeg[i__ + (ih + 12) * 700] = -wf / hi * hs / dpsq;
	++ih;
	if (ih > 2) {
	    ih = 1;
	}
	hi = sqrt((d__1 = ell_ .ek[i__ - 1] / dpd, (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ));
	fi = hi * ell_ .el[i__ - 1];
	si = sin(fi);
	co = cos(fi);
	aeg[i__ + (ih + 2) * 700] = co;
	aeg[i__ + (ih + 4) * 700] = si / hi;
	aeg[i__ + (ih + 6) * 700] = -si * hi;
	aeg[i__ + (ih + 8) * 700] = co;
	goto L190;
 

 
 

L170:
	ih = 1;
	fokq = - ell_ .ek[i__ - 1];
	goto L130;
 

 
 

L180:
	rhoi = ell_ .ed[i__ - 1] / dpsq;
	fok = rhoi * tan(ell_ .el[i__ - 1] * rhoi * .5);
	aeg[i__ + 2100] = 1.;
	aeg[i__ + 3500] = 0.;
	aeg[i__ + 4900] = fok;
	aeg[i__ + 6300] = 1.;
	aeg[i__ + 2800] = 1.;
	aeg[i__ + 4200] = 0.;
	aeg[i__ + 5600] = -fok;
	aeg[i__ + 7000] = 1.;
	goto L190;
 

 
 

L190:
	;
    }
    blockdis_(&aeg[2101], &bl1eg[901], &bl2eg[901]);
    return 0;
}  

 
 
  int envars_(j, dpp, rv)
integer *j;
doublereal *dpp, *rv;
{
     
    integer i__1;
    doublereal d__1;

     
    double sqrt(), tan(), sin(), cos(), exp();

     
    static doublereal g;
    static integer i__, l;
    static doublereal hc;
    static integer ih;
    static doublereal si, co, gl, hi, fi, hp, hm, hs, wf, hi1, as3, as4, as6, 
	    sm1, sm2, sm3, sm5;
    static integer kz1;
    static doublereal sm6, dpd, fok, dpsq, rho, fok1, sm12, sm23, rhoc, siq, 
	    aek, fokq, afok, wfa, wfhi, rhoi;

 

 
 
 

 

    dpd = *dpp + 1.;
    dpsq = sqrt(dpd);
    i__1 = str_ .il;
    for (i__ = 1; i__ <= i__1; ++i__) {
	if ((d__1 = ell_ .el[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    goto L190;
	}
	kz1 = ell_ .kz[i__ - 1] + 1;
	switch ((int)kz1) {
	    case 1:  goto L10;
	    case 2:  goto L30;
	    case 3:  goto L90;
	    case 4:  goto L50;
	    case 5:  goto L70;
	    case 6:  goto L80;
	    case 7:  goto L120;
	    case 8:  goto L170;
	    case 9:  goto L180;
	}
 

 
 

L10:
	for (l = 1; l <= 2; ++l) {
	    syos_ .al[(l + (*j + (i__ << 6) << 1)) * 6 - 786] = 1.;
	    syos_ .al[(l + (*j + (i__ << 6) << 1)) * 6 - 785] = ell_ .el[i__ 
		    - 1];
	    syos_ .al[(l + (*j + (i__ << 6) << 1)) * 6 - 784] = 0.;
	    syos_ .al[(l + (*j + (i__ << 6) << 1)) * 6 - 783] = 1.;
 
	    syos_ .as[(l + (*j + (i__ << 6) << 1)) * 6 - 781] = -(*rv) * 
		    syos_ .al[(l + (*j + (i__ << 6) << 1)) * 6 - 785] / 2e3;
	}
	syos_ .as[((*j + (i__ << 6) << 1) + 1) * 6 - 786] = ell_ .el[i__ - 1] 
		* (1. - *rv) * 1e3;
	goto L190;
 

 
 
 

L30:
	ih = 1;
L40:
	fok = ell_ .el[i__ - 1] * ell_ .ed[i__ - 1] / dpsq;
	if ((( fok ) >= 0 ? ( fok ) : -( fok ))  <= 1e-17) {
	    goto L10;
	}
	rho = 1. / ell_ .ed[i__ - 1] * dpsq;
	fok1 = tan(fok * .5) / rho;
	si = sin(fok);
	co = cos(fok);
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 786] = 1.;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785] = rho * si;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 784] = 0.;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 783] = 1.;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 782] = -(*dpp) * (rho * 
		(1. - co) / dpsq) * 1e3;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 781] = -(*dpp) * (tan(
		fok * .5) * 2. / dpsq) * 1e3;
	sm1 = cos(fok);
	sm2 = sin(fok) * rho;
	sm3 = -sin(fok) / rho;
	sm5 = -rho * dpsq * (1. - sm1);
	sm6 = -sm2 * dpsq / rho;
	sm12 = ell_ .el[i__ - 1] - sm1 * sm2;
	sm23 = sm2 * sm3;
	as3 = -(*rv) * (*dpp * rho / (dpsq * 2.) * sm23 + sm5);
	as4 = -(*rv) * sm23 / 2e3;
	as6 = -(*rv) * (ell_ .el[i__ - 1] + sm1 * sm2) / 4e3;
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 786] = (-(*rv) * (*dpp *
		 *dpp / (dpd * 4.) * sm12 + *dpp * (ell_ .el[i__ - 1] - sm2)) 
		+ ell_ .el[i__ - 1] * (1. - *rv)) * 1e3;
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 785] = -(*rv) * (*dpp / 
		(rho * 2. * dpsq) * sm12 + sm6) + fok1 * as3;
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 784] = as3;
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 783] = as4 + as6 * 2. * 
		fok1;
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 782] = -(*rv) * sm12 / (
		rho * 4e3 * rho) + as6 * fok1 * fok1 + fok1 * as4;
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 781] = as6;
 
	++ih;
	if (ih > 2) {
	    ih = 1;
	}
	g = tan(fok * .5) / rho;
	gl = ell_ .el[i__ - 1] * g;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 786] = 1. - gl;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785] = ell_ .el[i__ - 1]
		;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 784] = -g * (2. - gl);
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 783] = syos_ .al[(ih + (
		*j + (i__ << 6) << 1)) * 6 - 786];
	as6 = -(*rv) * syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785] / 
		2e3;
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 783] = as6 * -2. * fok1;
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 782] = as6 * fok1 * 
		fok1;
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 781] = as6;
	goto L190;
 

 
 
 

L50:
	ih = 1;
L60:
	fok = ell_ .el[i__ - 1] * ell_ .ed[i__ - 1] / dpsq;
	if ((( fok ) >= 0 ? ( fok ) : -( fok ))  <= 1e-17) {
	    goto L10;
	}
	rho = 1. / ell_ .ed[i__ - 1] * dpsq;
	si = sin(fok);
	co = cos(fok);
	rhoc = rho * (1. - co) / dpsq;
	siq = si / dpsq;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 786] = co;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785] = rho * si;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 784] = -si / rho;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 783] = co;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 782] = -(*dpp) * rhoc * 
		1e3;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 781] = -(*dpp) * siq * 
		1e3;
	sm12 = ell_ .el[i__ - 1] - syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 
		6 - 786] * syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785];
	sm23 = syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785] * syos_ .al[
		(ih + (*j + (i__ << 6) << 1)) * 6 - 784];
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 786] = (-(*rv) * (*dpp *
		 *dpp / (dpd * 4.) * sm12 + *dpp * (ell_ .el[i__ - 1] - 
		syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785])) + 
		ell_ .el[i__ - 1] * (1. - *rv)) * 1e3;
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 785] = -(*rv) * (*dpp / 
		(rho * 2. * dpsq) * sm12 - dpd * siq);
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 784] = -(*rv) * (*dpp * 
		rho / (dpsq * 2.) * sm23 - dpd * rhoc);
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 783] = -(*rv) * sm23 / 
		2e3;
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 782] = -(*rv) * sm12 / (
		rho * 4e3 * rho);
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 781] = -(*rv) * (
		ell_ .el[i__ - 1] + syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 
		6 - 786] * syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785])
		 / 4e3;
 
	++ih;
	if (ih > 2) {
	    ih = 1;
	}
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 786] = 1.;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785] = ell_ .el[i__ - 1]
		;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 784] = 0.;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 783] = 1.;
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 781] = -(*rv) * 
		syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785] / 2e3;
	goto L190;
 

 
 

L70:
	ih = 2;
	goto L40;
 

 
 

L80:
	ih = 2;
	goto L60;
 

 
 
 

L90:
	fok = ell_ .ek[i__ - 1] / (*dpp + 1.);
	aek = (( fok ) >= 0 ? ( fok ) : -( fok )) ;
	if ((( fok ) >= 0 ? ( fok ) : -( fok ))  <= 1e-17) {
	    goto L10;
	}
	ih = 0;
	hi = sqrt(aek);
	fi = ell_ .el[i__ - 1] * hi;
	if (fok > 0.) {
	    goto L110;
	}
L100:
	++ih;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 786] = cos(fi);
	hi1 = sin(fi);
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785] = hi1 / hi;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 784] = -hi1 * hi;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 783] = syos_ .al[(ih + (
		*j + (i__ << 6) << 1)) * 6 - 786];
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 786] = ell_ .el[i__ - 1]
		 * (1. - *rv) * 1e3;
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 783] = -(*rv) * 
		syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785] * 
		syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 784] / 2e3;
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 782] = -(*rv) * (
		ell_ .el[i__ - 1] - syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 
		6 - 786] * syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785])
		 * aek / 4e3;
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 781] = -(*rv) * (
		ell_ .el[i__ - 1] + syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 
		6 - 786] * syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785])
		 / 4e3;
	if (ih == 2) {
	    goto L190;
	}
 
L110:
	++ih;
	hp = exp(fi);
	hm = 1. / hp;
	hc = (hp + hm) * .5;
	hs = (hp - hm) * .5;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 786] = hc;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785] = hs / hi;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 784] = hs * hi;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 783] = hc;
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 783] = -(*rv) * 
		syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785] * 
		syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 784] / 2e3;
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 782] = *rv * (ell_ .el[
		i__ - 1] - syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 786] 
		* syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785]) * aek / 
		4e3;
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 781] = -(*rv) * (
		ell_ .el[i__ - 1] + syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 
		6 - 786] * syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785])
		 / 4e3;
	if (ih == 1) {
	    goto L100;
	}
	goto L190;
 

 
 
 

L120:
	ih = 0;
	fokq = ell_ .ek[i__ - 1];
L130:
	wf = ell_ .ed[i__ - 1] / dpsq;
	fok = fokq / dpd - wf * wf;
	if ((( fok ) >= 0 ? ( fok ) : -( fok ))  <= 1e-17) {
	    goto L10;
	}
	afok = (( fok ) >= 0 ? ( fok ) : -( fok )) ;
	hi = sqrt(afok);
	fi = hi * ell_ .el[i__ - 1];
	if (fok > 0.) {
	    goto L160;
	}
 
	++ih;
	si = sin(fi);
	co = cos(fi);
	wfa = wf / afok * (1. - co) / dpsq;
	wfhi = wf / hi * si / dpsq;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 786] = co;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785] = si / hi;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 784] = -si * hi;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 783] = co;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 782] = -wfa * *dpp * 
		1e3;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 781] = -wfhi * *dpp * 
		1e3;
	sm12 = ell_ .el[i__ - 1] - syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 
		6 - 786] * syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785];
	sm23 = syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785] * syos_ .al[
		(ih + (*j + (i__ << 6) << 1)) * 6 - 784];
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 786] = (-(*rv) * (*dpp *
		 *dpp / (dpd * 4.) * sm12 + *dpp * (ell_ .el[i__ - 1] - 
		syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785])) / afok * 
		wf * wf + ell_ .el[i__ - 1] * (1. - *rv)) * 1e3;
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 785] = -(*rv) * (*dpp * 
		wf / (dpsq * 2.) * sm12 - dpd * wfhi);
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 784] = -(*rv) * (*dpp * 
		.5 / afok / dpd * ell_ .ed[i__ - 1] * sm23 - dpd * wfa);
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 783] = -(*rv) * sm23 / 
		2e3;
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 782] = -(*rv) * sm12 * 
		afok / 4e3;
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 781] = -(*rv) * (
		ell_ .el[i__ - 1] + syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 
		6 - 786] * syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785])
		 / 4e3;
	++ih;
	if (ih > 2) {
	    ih = 1;
	}
	aek = (d__1 = ell_ .ek[i__ - 1] / dpd, (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
	hi = sqrt(aek);
	fi = hi * ell_ .el[i__ - 1];
	hp = exp(fi);
	hm = 1. / hp;
	hc = (hp + hm) * .5;
	hs = (hp - hm) * .5;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 786] = hc;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785] = ell_ .el[i__ - 1]
		;
	if ((( hi ) >= 0 ? ( hi ) : -( hi ))  <= 1e-17) {
	    goto L150;
	}
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785] = hs / hi;
L150:
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 784] = hs * hi;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 783] = hc;
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 783] = -(*rv) * 
		syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785] * 
		syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 784] / 2e3;
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 782] = *rv * (ell_ .el[
		i__ - 1] - syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 786] 
		* syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785]) * aek / 
		4e3;
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 781] = -(*rv) * (
		ell_ .el[i__ - 1] + syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 
		6 - 786] * syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785])
		 / 4e3;
	goto L190;
 
L160:
	++ih;
	hp = exp(fi);
	hm = 1. / hp;
	hc = (hp + hm) * .5;
	hs = (hp - hm) * .5;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 786] = hc;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785] = hs / hi;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 784] = hs * hi;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 783] = hc;
	wfa = wf / afok * (1. - hc) / dpsq;
	wfhi = wf / hi * hs / dpsq;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 782] = wfa * *dpp * 1e3;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 781] = -wfhi * *dpp * 
		1e3;
	sm12 = ell_ .el[i__ - 1] - syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 
		6 - 786] * syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785];
	sm23 = syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785] * syos_ .al[
		(ih + (*j + (i__ << 6) << 1)) * 6 - 784];
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 786] = (*rv * (*dpp * *
		dpp / (dpd * 4.) * sm12 + *dpp * (ell_ .el[i__ - 1] - 
		syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785])) / afok * 
		wf * wf + ell_ .el[i__ - 1] * (1. - *rv)) * 1e3;
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 785] = -(*rv) * (*dpp * 
		wf / (dpsq * 2.) * sm12 - dpd * wfhi);
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 784] = *rv * (*dpp * .5 
		/ afok / dpd * ell_ .ed[i__ - 1] * sm23 - dpd * wfa);
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 783] = -(*rv) * sm23 / 
		2e3;
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 782] = *rv * sm12 * 
		afok / 4e3;
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 781] = -(*rv) * (
		ell_ .el[i__ - 1] + syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 
		6 - 786] * syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785])
		 / 4e3;
	++ih;
	if (ih > 2) {
	    ih = 1;
	}
	aek = (d__1 = ell_ .ek[i__ - 1] / dpd, (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
	hi = sqrt(aek);
	fi = hi * ell_ .el[i__ - 1];
	si = sin(fi);
	co = cos(fi);
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 786] = co;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785] = si / hi;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 784] = -si * hi;
	syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 783] = co;
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 783] = -(*rv) * 
		syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785] * 
		syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 784] / 2e3;
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 782] = -(*rv) * (
		ell_ .el[i__ - 1] - syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 
		6 - 786] * syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785])
		 * aek / 4e3;
	syos_ .as[(ih + (*j + (i__ << 6) << 1)) * 6 - 781] = -(*rv) * (
		ell_ .el[i__ - 1] + syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 
		6 - 786] * syos_ .al[(ih + (*j + (i__ << 6) << 1)) * 6 - 785])
		 / 4e3;
	goto L190;
 

 
 

L170:
	ih = 1;
	fokq = - ell_ .ek[i__ - 1];
	goto L130;
 

 
 

L180:
	rhoi = ell_ .ed[i__ - 1] / dpsq;
	fok = rhoi * tan(ell_ .el[i__ - 1] * rhoi * .5);
	syos_ .al[((*j + (i__ << 6) << 1) + 1) * 6 - 786] = 1.;
	syos_ .al[((*j + (i__ << 6) << 1) + 1) * 6 - 785] = 0.;
	syos_ .al[((*j + (i__ << 6) << 1) + 1) * 6 - 784] = fok;
	syos_ .al[((*j + (i__ << 6) << 1) + 1) * 6 - 783] = 1.;
	syos_ .al[((*j + (i__ << 6) << 1) + 2) * 6 - 786] = 1.;
	syos_ .al[((*j + (i__ << 6) << 1) + 2) * 6 - 785] = 0.;
	syos_ .al[((*j + (i__ << 6) << 1) + 2) * 6 - 784] = -fok;
	syos_ .al[((*j + (i__ << 6) << 1) + 2) * 6 - 783] = 1.;
	goto L190;
 

 
 

L190:
	;
    }
    return 0;
}  

 
 
  int envarsv_(dpsv, oidpsv, rvv, ekv)
doublereal *dpsv, *oidpsv, *rvv, *ekv;
{
     
    integer i__1, i__2;
    doublereal d__1;

     
    double sqrt(), tan(), sin(), cos(), exp();

     
    static doublereal g[64];
    static integer j, l;
    static doublereal hc[64], si[64], co[64], gl[64], hp[64], hm[64], hs[64], 
	    wf[64], hi[64], fi[64], hi1[64];
    static integer ih1, ih2;
    static doublereal as3[64], as4[64], as6[64], sm1[64], sm2[64], sm3[64];
    static integer kz1;
    static doublereal fokqv[64], dpd[64], dpsq[64], fok[64], rho[64], fok1[64]
	    , sm12[64], sm23[64], rhoc[64], siq[64], aek[64], afok[64], wfa[
	    64], wfhi[64], rhoi[64], fokm;

 

 
 
 
 
 

 

 

     
    ekv -= 65;
    --rvv;
    --oidpsv;
    --dpsv;

     
    i__1 = tra1_ .napx;
    for (j = 1; j <= i__1; ++j) {
	dpd[j - 1] = dpsv[j] + 1.;
	dpsq[j - 1] = sqrt(dpd[j - 1]);
 
    }
    i__1 = str_ .il;
    for (l = 1; l <= i__1; ++l) {
	if ((d__1 = ell_ .el[l - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    goto L160;
	}
	kz1 = ell_ .kz[l - 1] + 1;
	switch ((int)kz1) {
	    case 1:  goto L20;
	    case 2:  goto L40;
	    case 3:  goto L80;
	    case 4:  goto L60;
	    case 5:  goto L40;
	    case 6:  goto L60;
	    case 7:  goto L100;
	    case 8:  goto L100;
	    case 9:  goto L140;
	}
 

 
 

L20:
	i__2 = tra1_ .napx;
	for (j = 1; j <= i__2; ++j) {
	    syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 786] = 1.;
	    syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 786] = 1.;
	    syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 785] = ell_ .el[l - 1];
	    syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 785] = ell_ .el[l - 1];
	    syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 784] = 0.;
	    syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 784] = 0.;
	    syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 783] = 1.;
	    syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 783] = 1.;
	    syos_ .as[((j + (l << 6) << 1) + 1) * 6 - 781] = -rvv[j] * 
		    ell_ .el[l - 1] / 2e3;
	    syos_ .as[((j + (l << 6) << 1) + 2) * 6 - 781] = syos_ .as[((j + (
		    l << 6) << 1) + 1) * 6 - 781];
	    syos_ .as[((j + (l << 6) << 1) + 1) * 6 - 786] = ell_ .el[l - 1] *
		     (1. - rvv[j]) * 1e3;
 
	}
	goto L160;
 

 
 
 

L40:
	fokm = ell_ .el[l - 1] * ell_ .ed[l - 1];
	if ((( fokm ) >= 0 ? ( fokm ) : -( fokm ))  <= 1e-17) {
	    goto L20;
	}
	if (kz1 == 2) {
	    ih1 = 1;
	    ih2 = 2;
	} else {
 
	    ih1 = 2;
	    ih2 = 1;
	}
	i__2 = tra1_ .napx;
	for (j = 1; j <= i__2; ++j) {
	    fok[j - 1] = fokm / dpsq[j - 1];
	    rho[j - 1] = 1. / ell_ .ed[l - 1] * dpsq[j - 1];
	    fok1[j - 1] = tan(fok[j - 1] * .5) / rho[j - 1];
	    si[j - 1] = sin(fok[j - 1]);
	    co[j - 1] = cos(fok[j - 1]);
	    syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 786] = 1.;
	    syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 785] = rho[j - 1] * 
		    si[j - 1];
	    syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 784] = 0.;
	    syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 783] = 1.;
	    syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 782] = -dpsv[j] * (
		    rho[j - 1] * (1. - co[j - 1]) / dpsq[j - 1]) * 1e3;
	    syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 781] = -dpsv[j] * (
		    tan(fok[j - 1] * .5) * 2. / dpsq[j - 1]) * 1e3;
	    sm1[j - 1] = cos(fok[j - 1]);
	    sm2[j - 1] = sin(fok[j - 1]) * rho[j - 1];
	    sm3[j - 1] = -sin(fok[j - 1]) / rho[j - 1];
	    sm12[j - 1] = ell_ .el[l - 1] - sm1[j - 1] * sm2[j - 1];
	    sm23[j - 1] = sm2[j - 1] * sm3[j - 1];
	    as3[j - 1] = -rvv[j] * (dpsv[j] * rho[j - 1] / (dpsq[j - 1] * 2.) 
		    * sm23[j - 1] - rho[j - 1] * dpsq[j - 1] * (1. - sm1[j - 
		    1]));
	    as4[j - 1] = -rvv[j] * sm23[j - 1] / 2e3;
	    as6[j - 1] = -rvv[j] * (ell_ .el[l - 1] + sm1[j - 1] * sm2[j - 1])
		     / 4e3;
	    syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 786] = (-rvv[j] * (
		    dpsv[j] * dpsv[j] / (dpd[j - 1] * 4.) * sm12[j - 1] + 
		    dpsv[j] * (ell_ .el[l - 1] - sm2[j - 1])) + ell_ .el[l - 
		    1] * (1. - rvv[j])) * 1e3;
	    syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 785] = -rvv[j] * (
		    dpsv[j] / (rho[j - 1] * 2. * dpsq[j - 1]) * sm12[j - 1] - 
		    sm2[j - 1] * dpsq[j - 1] / rho[j - 1]) + fok1[j - 1] * 
		    as3[j - 1];
	    syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 784] = as3[j - 1];
	    syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 783] = as4[j - 1] + 
		    as6[j - 1] * 2. * fok1[j - 1];
	    syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 782] = -rvv[j] * sm12[
		    j - 1] / (rho[j - 1] * 4e3 * rho[j - 1]) + as6[j - 1] * 
		    fok1[j - 1] * fok1[j - 1] + fok1[j - 1] * as4[j - 1];
	    syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 781] = as6[j - 1];
 
	    g[j - 1] = tan(fok[j - 1] * .5) / rho[j - 1];
	    gl[j - 1] = ell_ .el[l - 1] * g[j - 1];
	    syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 786] = 1. - gl[j - 1];
	    syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 785] = ell_ .el[l - 1]
		    ;
	    syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 784] = -g[j - 1] * (
		    2. - gl[j - 1]);
	    syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 783] = syos_ .al[(ih2 
		    + (j + (l << 6) << 1)) * 6 - 786];
	    as6[j - 1] = -rvv[j] * syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 
		    - 785] / 2e3;
	    syos_ .as[(ih2 + (j + (l << 6) << 1)) * 6 - 783] = as6[j - 1] * 
		    -2. * fok1[j - 1];
	    syos_ .as[(ih2 + (j + (l << 6) << 1)) * 6 - 782] = as6[j - 1] * 
		    fok1[j - 1] * fok1[j - 1];
	    syos_ .as[(ih2 + (j + (l << 6) << 1)) * 6 - 781] = as6[j - 1];
 
	}
	goto L160;
 

 
 
 

L60:
	fokm = ell_ .el[l - 1] * ell_ .ed[l - 1];
	if ((( fokm ) >= 0 ? ( fokm ) : -( fokm ))  <= 1e-17) {
	    goto L20;
	}
	if (kz1 == 4) {
	    ih1 = 1;
	    ih2 = 2;
	} else {
 
	    ih1 = 2;
	    ih2 = 1;
	}
	i__2 = tra1_ .napx;
	for (j = 1; j <= i__2; ++j) {
	    fok[j - 1] = fokm / dpsq[j - 1];
	    rho[j - 1] = 1. / ell_ .ed[l - 1] * dpsq[j - 1];
	    si[j - 1] = sin(fok[j - 1]);
	    co[j - 1] = cos(fok[j - 1]);
	    rhoc[j - 1] = rho[j - 1] * (1. - co[j - 1]) / dpsq[j - 1];
	    siq[j - 1] = si[j - 1] / dpsq[j - 1];
	    syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 786] = co[j - 1];
	    syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 785] = rho[j - 1] * 
		    si[j - 1];
	    syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 784] = -si[j - 1] / 
		    rho[j - 1];
	    syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 783] = co[j - 1];
	    syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 782] = -dpsv[j] * 
		    rhoc[j - 1] * 1e3;
	    syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 781] = -dpsv[j] * siq[
		    j - 1] * 1e3;
	    sm12[j - 1] = ell_ .el[l - 1] - syos_ .al[(ih1 + (j + (l << 6) << 
		    1)) * 6 - 786] * syos_ .al[(ih1 + (j + (l << 6) << 1)) * 
		    6 - 785];
	    sm23[j - 1] = syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 785] * 
		    syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 784];
	    syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 786] = (-rvv[j] * (
		    dpsv[j] * dpsv[j] / (dpd[j - 1] * 4.) * sm12[j - 1] + 
		    dpsv[j] * (ell_ .el[l - 1] - syos_ .al[(ih1 + (j + (l << 
		    6) << 1)) * 6 - 785])) + ell_ .el[l - 1] * (1. - rvv[j])) 
		    * 1e3;
	    syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 785] = -rvv[j] * (
		    dpsv[j] / (rho[j - 1] * 2. * dpsq[j - 1]) * sm12[j - 1] - 
		    dpd[j - 1] * siq[j - 1]);
	    syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 784] = -rvv[j] * (
		    dpsv[j] * rho[j - 1] / (dpsq[j - 1] * 2.) * sm23[j - 1] - 
		    dpd[j - 1] * rhoc[j - 1]);
	    syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 783] = -rvv[j] * sm23[
		    j - 1] / 2e3;
	    syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 782] = -rvv[j] * sm12[
		    j - 1] / (rho[j - 1] * 4e3 * rho[j - 1]);
	    syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 781] = -rvv[j] * (
		    ell_ .el[l - 1] + syos_ .al[(ih1 + (j + (l << 6) << 1)) * 
		    6 - 786] * syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 
		    785]) / 4e3;
 
	    syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 786] = 1.;
	    syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 785] = ell_ .el[l - 1]
		    ;
	    syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 784] = 0.;
	    syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 783] = 1.;
	    syos_ .as[(ih2 + (j + (l << 6) << 1)) * 6 - 781] = -rvv[j] * 
		    syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 785] / 2e3;
 
	}
	goto L160;
 

 
 
 

L80:
	i__2 = tra1_ .napx;
	for (j = 1; j <= i__2; ++j) {
	    fok[j - 1] = ekv[j + (l << 6)] * oidpsv[j];
	    aek[j - 1] = (d__1 = fok[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
	    hi[j - 1] = sqrt(aek[j - 1]);
	    fi[j - 1] = ell_ .el[l - 1] * hi[j - 1];
	    if (fok[j - 1] <= 0.) {
		syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 786] = cos(fi[j - 1]
			);
		hi1[j - 1] = sin(fi[j - 1]);
		if ((d__1 = hi[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
		    syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 785] = ell_ .el[
			    l - 1];
		} else {
		    syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 785] = hi1[j - 
			    1] / hi[j - 1];
		}
		syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 784] = -hi1[j - 1] *
			 hi[j - 1];
		syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 783] = syos_ .al[((
			j + (l << 6) << 1) + 1) * 6 - 786];
		syos_ .as[((j + (l << 6) << 1) + 1) * 6 - 786] = ell_ .el[l - 
			1] * (1. - rvv[j]) * 1e3;
		syos_ .as[((j + (l << 6) << 1) + 1) * 6 - 783] = -rvv[j] * 
			syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 785] * 
			syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 784] / 2e3;
		syos_ .as[((j + (l << 6) << 1) + 1) * 6 - 782] = -rvv[j] * (
			ell_ .el[l - 1] - syos_ .al[((j + (l << 6) << 1) + 1) 
			* 6 - 786] * syos_ .al[((j + (l << 6) << 1) + 1) * 6 
			- 785]) * aek[j - 1] / 4e3;
		syos_ .as[((j + (l << 6) << 1) + 1) * 6 - 781] = -rvv[j] * (
			ell_ .el[l - 1] + syos_ .al[((j + (l << 6) << 1) + 1) 
			* 6 - 786] * syos_ .al[((j + (l << 6) << 1) + 1) * 6 
			- 785]) / 4e3;
 
		hp[j - 1] = exp(fi[j - 1]);
		hm[j - 1] = 1. / hp[j - 1];
		hc[j - 1] = (hp[j - 1] + hm[j - 1]) * .5;
		hs[j - 1] = (hp[j - 1] - hm[j - 1]) * .5;
		syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 786] = hc[j - 1];
		if ((d__1 = hi[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
		    syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 785] = ell_ .el[
			    l - 1];
		} else {
		    syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 785] = hs[j - 1]
			     / hi[j - 1];
		}
		syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 784] = hs[j - 1] * 
			hi[j - 1];
		syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 783] = hc[j - 1];
		syos_ .as[((j + (l << 6) << 1) + 2) * 6 - 783] = -rvv[j] * 
			syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 785] * 
			syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 784] / 2e3;
		syos_ .as[((j + (l << 6) << 1) + 2) * 6 - 782] = rvv[j] * (
			ell_ .el[l - 1] - syos_ .al[((j + (l << 6) << 1) + 2) 
			* 6 - 786] * syos_ .al[((j + (l << 6) << 1) + 2) * 6 
			- 785]) * aek[j - 1] / 4e3;
		syos_ .as[((j + (l << 6) << 1) + 2) * 6 - 781] = -rvv[j] * (
			ell_ .el[l - 1] + syos_ .al[((j + (l << 6) << 1) + 2) 
			* 6 - 786] * syos_ .al[((j + (l << 6) << 1) + 2) * 6 
			- 785]) / 4e3;
	    } else {
		syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 786] = cos(fi[j - 1]
			);
		hi1[j - 1] = sin(fi[j - 1]);
		if ((d__1 = hi[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
		    syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 785] = ell_ .el[
			    l - 1];
		} else {
		    syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 785] = hi1[j - 
			    1] / hi[j - 1];
		}
		syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 784] = -hi1[j - 1] *
			 hi[j - 1];
		syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 783] = syos_ .al[((
			j + (l << 6) << 1) + 2) * 6 - 786];
		syos_ .as[((j + (l << 6) << 1) + 2) * 6 - 786] = ell_ .el[l - 
			1] * (1. - rvv[j]) * 1e3;
		syos_ .as[((j + (l << 6) << 1) + 2) * 6 - 783] = -rvv[j] * 
			syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 785] * 
			syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 784] / 2e3;
		syos_ .as[((j + (l << 6) << 1) + 2) * 6 - 782] = -rvv[j] * (
			ell_ .el[l - 1] - syos_ .al[((j + (l << 6) << 1) + 2) 
			* 6 - 786] * syos_ .al[((j + (l << 6) << 1) + 2) * 6 
			- 785]) * aek[j - 1] / 4e3;
		syos_ .as[((j + (l << 6) << 1) + 2) * 6 - 781] = -rvv[j] * (
			ell_ .el[l - 1] + syos_ .al[((j + (l << 6) << 1) + 2) 
			* 6 - 786] * syos_ .al[((j + (l << 6) << 1) + 2) * 6 
			- 785]) / 4e3;
 
		hp[j - 1] = exp(fi[j - 1]);
		hm[j - 1] = 1. / hp[j - 1];
		hc[j - 1] = (hp[j - 1] + hm[j - 1]) * .5;
		hs[j - 1] = (hp[j - 1] - hm[j - 1]) * .5;
		syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 786] = hc[j - 1];
		if ((d__1 = hi[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
		    syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 785] = ell_ .el[
			    l - 1];
		} else {
		    syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 785] = hs[j - 1]
			     / hi[j - 1];
		}
		syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 784] = hs[j - 1] * 
			hi[j - 1];
		syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 783] = hc[j - 1];
		syos_ .as[((j + (l << 6) << 1) + 1) * 6 - 783] = -rvv[j] * 
			syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 785] * 
			syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 784] / 2e3;
		syos_ .as[((j + (l << 6) << 1) + 1) * 6 - 782] = rvv[j] * (
			ell_ .el[l - 1] - syos_ .al[((j + (l << 6) << 1) + 1) 
			* 6 - 786] * syos_ .al[((j + (l << 6) << 1) + 1) * 6 
			- 785]) * aek[j - 1] / 4e3;
		syos_ .as[((j + (l << 6) << 1) + 1) * 6 - 781] = -rvv[j] * (
			ell_ .el[l - 1] + syos_ .al[((j + (l << 6) << 1) + 1) 
			* 6 - 786] * syos_ .al[((j + (l << 6) << 1) + 1) * 6 
			- 785]) / 4e3;
	    }
 
	}
	goto L160;
 

 
 
 

L100:
	if (kz1 == 7) {
	    i__2 = tra1_ .napx;
	    for (j = 1; j <= i__2; ++j) {
		fokqv[j - 1] = ekv[j + (l << 6)];
 
	    }
	    ih1 = 1;
	    ih2 = 2;
	} else {
 
	    i__2 = tra1_ .napx;
	    for (j = 1; j <= i__2; ++j) {
		fokqv[j - 1] = -ekv[j + (l << 6)];
 
	    }
	    ih1 = 2;
	    ih2 = 1;
	}
	i__2 = tra1_ .napx;
	for (j = 1; j <= i__2; ++j) {
	    wf[j - 1] = ell_ .ed[l - 1] / dpsq[j - 1];
	    fok[j - 1] = fokqv[j - 1] / dpd[j - 1] - wf[j - 1] * wf[j - 1];
	    afok[j - 1] = (d__1 = fok[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
	    hi[j - 1] = sqrt(afok[j - 1]);
	    fi[j - 1] = hi[j - 1] * ell_ .el[l - 1];
	    if (afok[j - 1] <= 1e-17) {
		syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 786] = 1.;
		syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 786] = 1.;
		syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 785] = ell_ .el[l - 
			1];
		syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 785] = ell_ .el[l - 
			1];
		syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 784] = 0.;
		syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 784] = 0.;
		syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 783] = 1.;
		syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 783] = 1.;
		syos_ .as[((j + (l << 6) << 1) + 1) * 6 - 781] = -rvv[j] * 
			ell_ .el[l - 1] / 2e3;
		syos_ .as[((j + (l << 6) << 1) + 2) * 6 - 781] = syos_ .as[((
			j + (l << 6) << 1) + 1) * 6 - 781];
		syos_ .as[((j + (l << 6) << 1) + 1) * 6 - 786] = ell_ .el[l - 
			1] * (1. - rvv[j]) * 1e3;
	    }
	    if (fok[j - 1] < -1e-17) {
		si[j - 1] = sin(fi[j - 1]);
		co[j - 1] = cos(fi[j - 1]);
		wfa[j - 1] = wf[j - 1] / afok[j - 1] * (1. - co[j - 1]) / 
			dpsq[j - 1];
		wfhi[j - 1] = wf[j - 1] / hi[j - 1] * si[j - 1] / dpsq[j - 1];
		syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 786] = co[j - 1];
		syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 785] = si[j - 1] /
			 hi[j - 1];
		syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 784] = -si[j - 1] 
			* hi[j - 1];
		syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 783] = co[j - 1];
		syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 782] = -wfa[j - 1]
			 * dpsv[j] * 1e3;
		syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 781] = -wfhi[j - 
			1] * dpsv[j] * 1e3;
		sm12[j - 1] = ell_ .el[l - 1] - syos_ .al[(ih1 + (j + (l << 6)
			 << 1)) * 6 - 786] * syos_ .al[(ih1 + (j + (l << 6) <<
			 1)) * 6 - 785];
		sm23[j - 1] = syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 785]
			 * syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 784];
		syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 786] = (-rvv[j] * 
			(dpsv[j] * dpsv[j] / (dpd[j - 1] * 4.) * sm12[j - 1] 
			+ dpsv[j] * (ell_ .el[l - 1] - syos_ .al[(ih1 + (j + (
			l << 6) << 1)) * 6 - 785])) / afok[j - 1] * wf[j - 1] 
			* wf[j - 1] + ell_ .el[l - 1] * (1. - rvv[j])) * 1e3;
		syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 785] = -rvv[j] * (
			dpsv[j] * wf[j - 1] / (dpsq[j - 1] * 2.) * sm12[j - 1]
			 - dpd[j - 1] * wfhi[j - 1]);
		syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 784] = -rvv[j] * (
			dpsv[j] * .5 / afok[j - 1] / dpd[j - 1] * ell_ .ed[l 
			- 1] * sm23[j - 1] - dpd[j - 1] * wfa[j - 1]);
		syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 783] = -rvv[j] * 
			sm23[j - 1] / 2e3;
		syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 782] = -rvv[j] * 
			sm12[j - 1] * afok[j - 1] / 4e3;
		syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 781] = -rvv[j] * (
			ell_ .el[l - 1] + syos_ .al[(ih1 + (j + (l << 6) << 1)
			) * 6 - 786] * syos_ .al[(ih1 + (j + (l << 6) << 1)) *
			 6 - 785]) / 4e3;
		aek[j - 1] = (d__1 = ekv[j + (l << 6)] / dpd[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) 
			);
		hi[j - 1] = sqrt(aek[j - 1]);
		fi[j - 1] = hi[j - 1] * ell_ .el[l - 1];
		hp[j - 1] = exp(fi[j - 1]);
		hm[j - 1] = 1. / hp[j - 1];
		hc[j - 1] = (hp[j - 1] + hm[j - 1]) * .5;
		hs[j - 1] = (hp[j - 1] - hm[j - 1]) * .5;
		syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 786] = hc[j - 1];
		syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 785] = ell_ .el[l 
			- 1];
		if ((d__1 = hi[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		    syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 785] = hs[j - 
			    1] / hi[j - 1];
		}
		syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 784] = hs[j - 1] *
			 hi[j - 1];
		syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 783] = hc[j - 1];
		syos_ .as[(ih2 + (j + (l << 6) << 1)) * 6 - 783] = -rvv[j] * 
			syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 785] * 
			syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 784] / 
			2e3;
		syos_ .as[(ih2 + (j + (l << 6) << 1)) * 6 - 782] = rvv[j] * (
			ell_ .el[l - 1] - syos_ .al[(ih2 + (j + (l << 6) << 1)
			) * 6 - 786] * syos_ .al[(ih2 + (j + (l << 6) << 1)) *
			 6 - 785]) * aek[j - 1] / 4e3;
		syos_ .as[(ih2 + (j + (l << 6) << 1)) * 6 - 781] = -rvv[j] * (
			ell_ .el[l - 1] + syos_ .al[(ih2 + (j + (l << 6) << 1)
			) * 6 - 786] * syos_ .al[(ih2 + (j + (l << 6) << 1)) *
			 6 - 785]) / 4e3;
	    }
 
	    if (fok[j - 1] > 1e-17) {
		hp[j - 1] = exp(fi[j - 1]);
		hm[j - 1] = 1. / hp[j - 1];
		hc[j - 1] = (hp[j - 1] + hm[j - 1]) * .5;
		hs[j - 1] = (hp[j - 1] - hm[j - 1]) * .5;
		syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 786] = hc[j - 1];
		syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 785] = hs[j - 1] /
			 hi[j - 1];
		syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 784] = hs[j - 1] *
			 hi[j - 1];
		syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 783] = hc[j - 1];
		wfa[j - 1] = wf[j - 1] / afok[j - 1] * (1. - hc[j - 1]) / 
			dpsq[j - 1];
		wfhi[j - 1] = wf[j - 1] / hi[j - 1] * hs[j - 1] / dpsq[j - 1];
		syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 782] = wfa[j - 1] 
			* dpsv[j] * 1e3;
		syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 781] = -wfhi[j - 
			1] * dpsv[j] * 1e3;
		sm12[j - 1] = ell_ .el[l - 1] - syos_ .al[(ih1 + (j + (l << 6)
			 << 1)) * 6 - 786] * syos_ .al[(ih1 + (j + (l << 6) <<
			 1)) * 6 - 785];
		sm23[j - 1] = syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 785]
			 * syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 784];
		syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 786] = (rvv[j] * (
			dpsv[j] * dpsv[j] / (dpd[j - 1] * 4.) * sm12[j - 1] + 
			dpsv[j] * (ell_ .el[l - 1] - syos_ .al[(ih1 + (j + (l 
			<< 6) << 1)) * 6 - 785])) / afok[j - 1] * wf[j - 1] * 
			wf[j - 1] + ell_ .el[l - 1] * (1. - rvv[j])) * 1e3;
		syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 785] = -rvv[j] * (
			dpsv[j] * wf[j - 1] / (dpsq[j - 1] * 2.) * sm12[j - 1]
			 - dpd[j - 1] * wfhi[j - 1]);
		syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 784] = rvv[j] * (
			dpsv[j] * .5 / afok[j - 1] / dpd[j - 1] * ell_ .ed[l 
			- 1] * sm23[j - 1] - dpd[j - 1] * wfa[j - 1]);
		syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 783] = -rvv[j] * 
			sm23[j - 1] / 2e3;
		syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 782] = rvv[j] * 
			sm12[j - 1] * afok[j - 1] / 4e3;
		syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 781] = -rvv[j] * (
			ell_ .el[l - 1] + syos_ .al[(ih1 + (j + (l << 6) << 1)
			) * 6 - 786] * syos_ .al[(ih1 + (j + (l << 6) << 1)) *
			 6 - 785]) / 4e3;
		aek[j - 1] = (d__1 = ekv[j + (l << 6)] / dpd[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) 
			);
		hi[j - 1] = sqrt(aek[j - 1]);
		fi[j - 1] = hi[j - 1] * ell_ .el[l - 1];
		si[j - 1] = sin(fi[j - 1]);
		co[j - 1] = cos(fi[j - 1]);
		syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 786] = co[j - 1];
		syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 785] = si[j - 1] /
			 hi[j - 1];
		syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 784] = -si[j - 1] 
			* hi[j - 1];
		syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 783] = co[j - 1];
		syos_ .as[(ih2 + (j + (l << 6) << 1)) * 6 - 783] = -rvv[j] * 
			syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 785] * 
			syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 784] / 
			2e3;
		syos_ .as[(ih2 + (j + (l << 6) << 1)) * 6 - 782] = -rvv[j] * (
			ell_ .el[l - 1] - syos_ .al[(ih2 + (j + (l << 6) << 1)
			) * 6 - 786] * syos_ .al[(ih2 + (j + (l << 6) << 1)) *
			 6 - 785]) * aek[j - 1] / 4e3;
		syos_ .as[(ih2 + (j + (l << 6) << 1)) * 6 - 781] = -rvv[j] * (
			ell_ .el[l - 1] + syos_ .al[(ih2 + (j + (l << 6) << 1)
			) * 6 - 786] * syos_ .al[(ih2 + (j + (l << 6) << 1)) *
			 6 - 785]) / 4e3;
	    }
 
	}
	goto L160;
 

 
 

L140:
	i__2 = tra1_ .napx;
	for (j = 1; j <= i__2; ++j) {
	    rhoi[j - 1] = ell_ .ed[l - 1] / dpsq[j - 1];
	    fok[j - 1] = rhoi[j - 1] * tan(ell_ .el[l - 1] * rhoi[j - 1] * .5)
		    ;
	    syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 786] = 1.;
	    syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 785] = 0.;
	    syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 784] = fok[j - 1];
	    syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 783] = 1.;
	    syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 786] = 1.;
	    syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 785] = 0.;
	    syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 784] = -fok[j - 1];
	    syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 783] = 1.;
 
	}
L160:
	;
    }
    return 0;
}  

 
 
  int envquad_(i__, ipch)
integer *i__, *ipch;
{
     
    doublereal d__1;

     
    static integer g, hc, si, co, gl, hi, fi, hp, hm, hs, wf, ih, hi1, as3, 
	    as4, as6, sm1, sm2, sm3, sm4, sm5, sm6, fokq, wfhi, dpd, dpsq, 
	    fok, rho, fok1, sm12, sm23, siq, rhoc, aek, fokc, afok, rhoi, wfa;
    extern   int dakey_(), daall_();
    static integer idaa;
    extern   int dacad_(), dacop_(), dafun_(), dacmu_(), 
	    dadiv_();
    extern doublereal dare_();
    extern   int damul_(), dasuc_(), dacdi_(), dadic_(), 
	    daadd_(), dasub_(), dadal_();

 

 
 
 
 

 

 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
    if ((1) ) {
	dakey_("FOX V2.1", 8L);
	daall_(&fokq, &c__1, "FOKQ      ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&wfhi, &c__1, "WFHI      ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&dpd, &c__1, "DPD       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&dpsq, &c__1, "DPSQ      ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&fok, &c__1, "FOK       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&rho, &c__1, "RHO       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&fok1, &c__1, "FOK1      ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&sm1, &c__1, "SM1       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&sm2, &c__1, "SM2       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&sm3, &c__1, "SM3       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&sm4, &c__1, "SM4       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&sm5, &c__1, "SM5       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&sm6, &c__1, "SM6       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&sm12, &c__1, "SM12      ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&sm23, &c__1, "SM23      ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&as3, &c__1, "AS3       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&as4, &c__1, "AS4       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&as6, &c__1, "AS6       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&si, &c__1, "SI        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&co, &c__1, "CO        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&g, &c__1, "G         ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&gl, &c__1, "GL        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&siq, &c__1, "SIQ       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&rhoc, &c__1, "RHOC      ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&hi, &c__1, "HI        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&fi, &c__1, "FI        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&aek, &c__1, "AEK       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&hi1, &c__1, "HI1       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&hp, &c__1, "HP        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&hm, &c__1, "HM        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&hc, &c__1, "HC        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&hs, &c__1, "HS        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&fokc, &c__1, "FOKC      ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&wf, &c__1, "WF        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&afok, &c__1, "AFOK      ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&rhoi, &c__1, "RHOI      ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&wfa, &c__1, "WFA       ", & dial_ .nord, & dial_ .nvar, 10L);
    }
    idaa = dascr_ .idao;
 
 

 

    dacad_(& daele_ .dpda, &c_b2366, & dascr_ .iscrda[idaa]);
    dacop_(& dascr_ .iscrda[idaa], &dpd);
 

    dafun_("SQRT  ", &dpd, & dascr_ .iscrda[idaa], 6L);
    dacop_(& dascr_ .iscrda[idaa], &dpsq);
 

 
 
 

    if ((d__1 = ell_ .ek[*i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	goto L100;
    }
 

    dacop_(& daele_ .smida[*ipch - 1], & dascr_ .iscrda[idaa]);
    dascr_ .rscrri[idaa + 1] = combin_ .ratioe[*i__ - 1];
    d__1 = dascr_ .rscrri[idaa + 1] * 1.;
    dacmu_(& dascr_ .iscrda[idaa], &d__1, & dascr_ .iscrda[idaa + 2]);
    dacad_(& daele_ .dpda, &c_b2366, & dascr_ .iscrda[idaa + 3]);
    dadiv_(& dascr_ .iscrda[idaa + 2], & dascr_ .iscrda[idaa + 3], &
	    dascr_ .iscrda[idaa + 4]);
    dacop_(& dascr_ .iscrda[idaa + 4], &fok);
 

 

    dacop_(&fok, &aek);
    if (dare_(&aek) < 0.) {
 

	dacmu_(&aek, &c_b2381, & dascr_ .iscrda[idaa]);
	dacop_(& dascr_ .iscrda[idaa], &aek);
    }
    ih = 0;
 

    dafun_("SQRT  ", &aek, & dascr_ .iscrda[idaa], 6L);
    dacop_(& dascr_ .iscrda[idaa], &hi);
 

    dascr_ .rscrri[idaa] = ell_ .el[*i__ - 1];
    d__1 = dascr_ .rscrri[idaa] * 1.;
    dacmu_(&hi, &d__1, & dascr_ .iscrda[idaa + 1]);
    dacop_(& dascr_ .iscrda[idaa + 1], &fi);
    if (ell_ .ek[*i__ - 1] > 0.) {
	goto L30;
    }
L20:
    ++ih;
 

    dafun_("COS   ", &fi, & dascr_ .iscrda[idaa], 6L);
    dacop_(& dascr_ .iscrda[idaa], & daele_ .aldaq[ih - 1]);
 

    dafun_("SIN   ", &fi, & dascr_ .iscrda[idaa], 6L);
    dacop_(& dascr_ .iscrda[idaa], &hi1);
 

    dadiv_(&hi1, &hi, & dascr_ .iscrda[idaa]);
    dacop_(& dascr_ .iscrda[idaa], & daele_ .aldaq[ih + 1]);
 

    dacmu_(&hi1, &c_b2381, & dascr_ .iscrda[idaa]);
    damul_(& dascr_ .iscrda[idaa], &hi, & dascr_ .iscrda[idaa + 1]);
    dacop_(& dascr_ .iscrda[idaa + 1], & daele_ .aldaq[ih + 3]);
 

    dacop_(& daele_ .aldaq[ih - 1], & dascr_ .iscrda[idaa]);
    dacop_(& dascr_ .iscrda[idaa], & daele_ .aldaq[ih + 5]);
 

    dasuc_(& daele_ .rv, &c_b2366, & dascr_ .iscrda[idaa]);
    dascr_ .rscrri[idaa + 1] = ell_ .el[*i__ - 1];
    d__1 = dascr_ .rscrri[idaa + 1] * 1.;
    dacmu_(& dascr_ .iscrda[idaa], &d__1, & dascr_ .iscrda[idaa + 2]);
    dacmu_(& dascr_ .iscrda[idaa + 2], &c_b2384, & dascr_ .iscrda[idaa + 3]);
    dacop_(& dascr_ .iscrda[idaa + 3], & daele_ .asdaq[ih - 1]);
 

    dacop_(& daele_ .aldaq[ih + 1], & dascr_ .iscrda[idaa]);
    dacop_(& daele_ .aldaq[ih + 3], & dascr_ .iscrda[idaa + 1]);
    dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 2]);
    damul_(& dascr_ .iscrda[idaa + 2], & dascr_ .iscrda[idaa], & dascr_ .iscrda[
	    idaa + 3]);
    damul_(& dascr_ .iscrda[idaa + 3], & dascr_ .iscrda[idaa + 1], &
	    dascr_ .iscrda[idaa + 4]);
    dacdi_(& dascr_ .iscrda[idaa + 4], &c_b2382, & dascr_ .iscrda[idaa + 5]);
    dacop_(& dascr_ .iscrda[idaa + 5], & daele_ .asdaq[ih + 5]);
 

    dascr_ .rscrri[idaa] = ell_ .el[*i__ - 1];
    dacop_(& daele_ .aldaq[ih - 1], & dascr_ .iscrda[idaa + 1]);
    dacop_(& daele_ .aldaq[ih + 1], & dascr_ .iscrda[idaa + 2]);
    damul_(& dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa + 2], &
	    dascr_ .iscrda[idaa + 3]);
    d__1 = dascr_ .rscrri[idaa] * 1.;
    dasuc_(& dascr_ .iscrda[idaa + 3], &d__1, & dascr_ .iscrda[idaa + 4]);
    dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 5]);
    damul_(& dascr_ .iscrda[idaa + 5], & dascr_ .iscrda[idaa + 4], &
	    dascr_ .iscrda[idaa + 6]);
    damul_(& dascr_ .iscrda[idaa + 6], &aek, & dascr_ .iscrda[idaa + 7]);
    dacdi_(& dascr_ .iscrda[idaa + 7], &c_b2414, & dascr_ .iscrda[idaa + 8]);
    dacop_(& dascr_ .iscrda[idaa + 8], & daele_ .asdaq[ih + 7]);
 

    dascr_ .rscrri[idaa] = ell_ .el[*i__ - 1];
    dacop_(& daele_ .aldaq[ih - 1], & dascr_ .iscrda[idaa + 1]);
    dacop_(& daele_ .aldaq[ih + 1], & dascr_ .iscrda[idaa + 2]);
    damul_(& dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa + 2], &
	    dascr_ .iscrda[idaa + 3]);
    d__1 = dascr_ .rscrri[idaa] * 1.;
    dacad_(& dascr_ .iscrda[idaa + 3], &d__1, & dascr_ .iscrda[idaa + 4]);
    dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 5]);
    damul_(& dascr_ .iscrda[idaa + 5], & dascr_ .iscrda[idaa + 4], &
	    dascr_ .iscrda[idaa + 6]);
    dacdi_(& dascr_ .iscrda[idaa + 6], &c_b2414, & dascr_ .iscrda[idaa + 7]);
    dacop_(& dascr_ .iscrda[idaa + 7], & daele_ .asdaq[ih + 9]);
    if (ih == 2) {
	goto L100;
    }
 
L30:
    ++ih;
 

    dafun_("EXP   ", &fi, & dascr_ .iscrda[idaa], 6L);
    dacop_(& dascr_ .iscrda[idaa], &hp);
 

    dadic_(&hp, &c_b2366, & dascr_ .iscrda[idaa]);
    dacop_(& dascr_ .iscrda[idaa], &hm);
 

    daadd_(&hp, &hm, & dascr_ .iscrda[idaa]);
    dacmu_(& dascr_ .iscrda[idaa], &c_b461, & dascr_ .iscrda[idaa + 1]);
    dacop_(& dascr_ .iscrda[idaa + 1], &hc);
 

    dasub_(&hp, &hm, & dascr_ .iscrda[idaa]);
    dacmu_(& dascr_ .iscrda[idaa], &c_b461, & dascr_ .iscrda[idaa + 1]);
    dacop_(& dascr_ .iscrda[idaa + 1], &hs);
 

    dacop_(&hc, & daele_ .aldaq[ih - 1]);
 

    dadiv_(&hs, &hi, & dascr_ .iscrda[idaa]);
    dacop_(& dascr_ .iscrda[idaa], & daele_ .aldaq[ih + 1]);
 

    damul_(&hs, &hi, & dascr_ .iscrda[idaa]);
    dacop_(& dascr_ .iscrda[idaa], & daele_ .aldaq[ih + 3]);
 

    dacop_(&hc, & daele_ .aldaq[ih + 5]);
 

    dacop_(& daele_ .aldaq[ih + 1], & dascr_ .iscrda[idaa]);
    dacop_(& daele_ .aldaq[ih + 3], & dascr_ .iscrda[idaa + 1]);
    dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 2]);
    damul_(& dascr_ .iscrda[idaa + 2], & dascr_ .iscrda[idaa], & dascr_ .iscrda[
	    idaa + 3]);
    damul_(& dascr_ .iscrda[idaa + 3], & dascr_ .iscrda[idaa + 1], &
	    dascr_ .iscrda[idaa + 4]);
    dacdi_(& dascr_ .iscrda[idaa + 4], &c_b2382, & dascr_ .iscrda[idaa + 5]);
    dacop_(& dascr_ .iscrda[idaa + 5], & daele_ .asdaq[ih + 5]);
 

    dascr_ .rscrri[idaa] = ell_ .el[*i__ - 1];
    dacop_(& daele_ .aldaq[ih - 1], & dascr_ .iscrda[idaa + 1]);
    dacop_(& daele_ .aldaq[ih + 1], & dascr_ .iscrda[idaa + 2]);
    damul_(& dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa + 2], &
	    dascr_ .iscrda[idaa + 3]);
    d__1 = dascr_ .rscrri[idaa] * 1.;
    dasuc_(& dascr_ .iscrda[idaa + 3], &d__1, & dascr_ .iscrda[idaa + 4]);
    damul_(& daele_ .rv, & dascr_ .iscrda[idaa + 4], & dascr_ .iscrda[idaa + 5]);
    damul_(& dascr_ .iscrda[idaa + 5], &aek, & dascr_ .iscrda[idaa + 6]);
    dacdi_(& dascr_ .iscrda[idaa + 6], &c_b2414, & dascr_ .iscrda[idaa + 7]);
    dacop_(& dascr_ .iscrda[idaa + 7], & daele_ .asdaq[ih + 7]);
 

    dascr_ .rscrri[idaa] = ell_ .el[*i__ - 1];
    dacop_(& daele_ .aldaq[ih - 1], & dascr_ .iscrda[idaa + 1]);
    dacop_(& daele_ .aldaq[ih + 1], & dascr_ .iscrda[idaa + 2]);
    damul_(& dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa + 2], &
	    dascr_ .iscrda[idaa + 3]);
    d__1 = dascr_ .rscrri[idaa] * 1.;
    dacad_(& dascr_ .iscrda[idaa + 3], &d__1, & dascr_ .iscrda[idaa + 4]);
    dacmu_(& daele_ .rv, &c_b2381, & dascr_ .iscrda[idaa + 5]);
    damul_(& dascr_ .iscrda[idaa + 5], & dascr_ .iscrda[idaa + 4], &
	    dascr_ .iscrda[idaa + 6]);
    dacdi_(& dascr_ .iscrda[idaa + 6], &c_b2414, & dascr_ .iscrda[idaa + 7]);
    dacop_(& dascr_ .iscrda[idaa + 7], & daele_ .asdaq[ih + 9]);
    if (ih == 1) {
	goto L20;
    }
L100:
    dadal_(&wfa, &c__1);
    dadal_(&rhoi, &c__1);
    dadal_(&afok, &c__1);
    dadal_(&wf, &c__1);
    dadal_(&fokc, &c__1);
    dadal_(&hs, &c__1);
    dadal_(&hc, &c__1);
    dadal_(&hm, &c__1);
    dadal_(&hp, &c__1);
    dadal_(&hi1, &c__1);
    dadal_(&aek, &c__1);
    dadal_(&fi, &c__1);
    dadal_(&hi, &c__1);
    dadal_(&rhoc, &c__1);
    dadal_(&siq, &c__1);
    dadal_(&gl, &c__1);
    dadal_(&g, &c__1);
    dadal_(&co, &c__1);
    dadal_(&si, &c__1);
    dadal_(&as6, &c__1);
    dadal_(&as4, &c__1);
    dadal_(&as3, &c__1);
    dadal_(&sm23, &c__1);
    dadal_(&sm12, &c__1);
    dadal_(&sm6, &c__1);
    dadal_(&sm5, &c__1);
    dadal_(&sm4, &c__1);
    dadal_(&sm3, &c__1);
    dadal_(&sm2, &c__1);
    dadal_(&sm1, &c__1);
    dadal_(&fok1, &c__1);
    dadal_(&rho, &c__1);
    dadal_(&fok, &c__1);
    dadal_(&dpsq, &c__1);
    dadal_(&dpd, &c__1);
    dadal_(&wfhi, &c__1);
    dadal_(&fokq, &c__1);
 
    return 0;
}  

  int errf_(xx, yy, wx, wy)
doublereal *xx, *yy, *wx, *wy;
{
     
    integer i__1;
    doublereal d__1;

     
    double sqrt(), pow_di(), exp(), cos(), sin();

     
    static doublereal h__;
    static integer n;
    static doublereal q, x, y;
    static integer nc;
    static doublereal xh, yh, tn;
    static integer nu;
    static doublereal xl, rx[33], ry[33], tx, ty, sx, sy, saux;

 

 

 

 

 

 

 

 

 

 

 
    x = (( *xx ) >= 0 ? ( *xx ) : -( *xx )) ;
    y = (( *yy ) >= 0 ? ( *yy ) : -( *yy )) ;
    if (y < 4.29 && x < 5.33) {
 
	d__1 = x / 5.33;
	q = (1. - y / 4.29) * sqrt(1. - d__1 * d__1);
	h__ = 1. / (q * 3.2);
	nc = (integer) (q * (float)23.) + 7;
	i__1 = 1 - nc;
	xl = pow_di(&h__, &i__1);
	xh = y + .5 / h__;
	yh = x;
	nu = (integer) (q * (float)21.) + 10;
	rx[nu] = (float)0.;
	ry[nu] = (float)0.;
	for (n = nu; n >= 1; --n) {
	    tx = xh + n * rx[n];
	    ty = yh - n * ry[n];
	    tn = tx * tx + ty * ty;
	    rx[n - 1] = tx * .5 / tn;
	    ry[n - 1] = ty * .5 / tn;
 
	}
	sx = (float)0.;
	sy = (float)0.;
	for (n = nc; n >= 1; --n) {
	    saux = sx + xl;
	    sx = rx[n - 1] * saux - ry[n - 1] * sy;
	    sy = rx[n - 1] * sy + ry[n - 1] * saux;
	    xl = h__ * xl;
 
	}
	*wx = sx * 1.12837916709551;
	*wy = sy * 1.12837916709551;
    } else {
	xh = y;
	yh = x;
	rx[0] = (float)0.;
	ry[0] = (float)0.;
	for (n = 9; n >= 1; --n) {
	    tx = xh + n * rx[0];
	    ty = yh - n * ry[0];
	    tn = tx * tx + ty * ty;
	    rx[0] = tx * .5 / tn;
	    ry[0] = ty * .5 / tn;
 
	}
	*wx = rx[0] * 1.12837916709551;
	*wy = ry[0] * 1.12837916709551;
    }
    if (y == (float)0.) {
 
	d__1 = x;
	*wx = exp(-(d__1 * d__1));
    }
    if (*yy < (float)0.) {
	*wx = exp(y * y - x * x) * 2. * cos(x * 2. * y) - *wx;
	*wy = exp(y * y - x * x) * -2. * sin(x * 2. * y) - *wy;
	if (*xx > (float)0.) {
	    *wy = -(*wy);
	}
    } else {
	if (*xx < (float)0.) {
	    *wy = -(*wy);
	}
    }
}  

  int errff_(xx, yy, wx, wy, ix)
integer *xx, *yy, *wx, *wy, *ix;
{
     
    doublereal d__1;

     
    static integer h__, n, q, x, y, n1, nc, xh, yh, tn, xl, rx[33], ry[33], 
	    tx, ty, sx, sy, saux;
    extern   int dakey_(), daall_();
    static integer idaa;
    extern   int dacop_();
    extern doublereal dare_();
    extern   int dacmu_(), dacdi_(), daexc_(), dasuc_(), 
	    dafun_(), damul_(), dadic_(), daadd_();
    static integer nuu, nuu1;
    extern   int dacon_(), dasub_(), dadiv_(), dadal_();

 

 

 
 

 

 

 

 

 

 

 

 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
    if (dial_ .idalloc == 1 || dial_ .idalloc == 3) {
	dakey_("FOX V2.1", 8L);
	daall_(&x, &c__1, "X         ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&y, &c__1, "Y         ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&q, &c__1, "Q         ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&h__, &c__1, "H         ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&xh, &c__1, "XH        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&yh, &c__1, "YH        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(rx, &c__33, "RX        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(ry, &c__33, "RY        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&tx, &c__1, "TX        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&tn, &c__1, "TN        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&ty, &c__1, "TY        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&saux, &c__1, "SAUX      ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&sx, &c__1, "SX        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&sy, &c__1, "SY        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&xl, &c__1, "XL        ", & dial_ .nord, & dial_ .nvar, 10L);
    }
    idaa = dascr_ .idao;
 
 

    if (dial_ .idalloc == 1) {
	dial_ .idalloc = 0;
    }
    if (dial_ .idalloc == 3) {
	dial_ .idalloc = 2;
    }
 

 

    dacop_(xx, &x);
    if (dare_(&x) < 0.) {
 

	dacmu_(&x, &c_b2381, & dascr_ .iscrda[idaa]);
	dacop_(& dascr_ .iscrda[idaa], &x);
    }
 

 

    dacop_(yy, &y);
    if (dare_(&y) < 0.) {
 

	dacmu_(&y, &c_b2381, & dascr_ .iscrda[idaa]);
	dacop_(& dascr_ .iscrda[idaa], &y);
    }
    if (dare_(&y) < 4.29 && dare_(&x) < 5.33) {
 

	dacdi_(&x, &c_b2856, & dascr_ .iscrda[idaa]);
	daexc_(& dascr_ .iscrda[idaa], &c_b2400, & dascr_ .iscrda[idaa + 1]);
	dacdi_(&y, &c_b2858, & dascr_ .iscrda[idaa + 2]);
	dasuc_(& dascr_ .iscrda[idaa + 2], &c_b2366, & dascr_ .iscrda[idaa + 3])
		;
	dasuc_(& dascr_ .iscrda[idaa + 1], &c_b2366, & dascr_ .iscrda[idaa + 4])
		;
	dafun_("SQRT  ", & dascr_ .iscrda[idaa + 4], & dascr_ .iscrda[idaa + 5],
		 6L);
	damul_(& dascr_ .iscrda[idaa + 3], & dascr_ .iscrda[idaa + 5], &
		dascr_ .iscrda[idaa + 6]);
	dacop_(& dascr_ .iscrda[idaa + 6], &q);
 

	dacmu_(&q, &c_b2862, & dascr_ .iscrda[idaa]);
	dadic_(& dascr_ .iscrda[idaa], &c_b2366, & dascr_ .iscrda[idaa + 1]);
	dacop_(& dascr_ .iscrda[idaa + 1], &h__);
	nc = (integer) (dare_(&q) * (float)23.) + 7;
 

	dascr_ .iscrri[idaa] = 1 - nc;
	d__1 = dascr_ .iscrri[idaa] * 1.;
	daexc_(&h__, &d__1, & dascr_ .iscrda[idaa + 1]);
	dacop_(& dascr_ .iscrda[idaa + 1], &xl);
 

	dadic_(&h__, &c_b461, & dascr_ .iscrda[idaa]);
	daadd_(&y, & dascr_ .iscrda[idaa], & dascr_ .iscrda[idaa + 1]);
	dacop_(& dascr_ .iscrda[idaa + 1], &xh);
 

	dacop_(&x, &yh);
	nuu = (integer) (dare_(&q) * (float)21.) + 10;
	nuu1 = nuu + 1;
 

	dascr_ .rscrri[99] = (float)0.;
	dacon_(&rx[nuu1 - 1], & dascr_ .rscrri[99]);
 

	dascr_ .rscrri[99] = (float)0.;
	dacon_(&ry[nuu1 - 1], & dascr_ .rscrri[99]);
	for (n = nuu; n >= 1; --n) {
	    n1 = n + 1;
 

	    dacop_(&rx[n1 - 1], & dascr_ .iscrda[idaa]);
	    d__1 = n * 1.;
	    dacmu_(& dascr_ .iscrda[idaa], &d__1, & dascr_ .iscrda[idaa + 1]);
	    daadd_(&xh, & dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa + 2]);
	    dacop_(& dascr_ .iscrda[idaa + 2], &tx);
 

	    dacop_(&ry[n1 - 1], & dascr_ .iscrda[idaa]);
	    d__1 = n * 1.;
	    dacmu_(& dascr_ .iscrda[idaa], &d__1, & dascr_ .iscrda[idaa + 1]);
	    dasub_(&yh, & dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa + 2]);
	    dacop_(& dascr_ .iscrda[idaa + 2], &ty);
 

	    damul_(&tx, &tx, & dascr_ .iscrda[idaa]);
	    damul_(&ty, &ty, & dascr_ .iscrda[idaa + 1]);
	    daadd_(& dascr_ .iscrda[idaa], & dascr_ .iscrda[idaa + 1], &
		    dascr_ .iscrda[idaa + 2]);
	    dacop_(& dascr_ .iscrda[idaa + 2], &tn);
 

	    dacmu_(&tx, &c_b461, & dascr_ .iscrda[idaa]);
	    dadiv_(& dascr_ .iscrda[idaa], &tn, & dascr_ .iscrda[idaa + 1]);
	    dacop_(& dascr_ .iscrda[idaa + 1], &rx[n - 1]);
 

	    dacmu_(&ty, &c_b461, & dascr_ .iscrda[idaa]);
	    dadiv_(& dascr_ .iscrda[idaa], &tn, & dascr_ .iscrda[idaa + 1]);
	    dacop_(& dascr_ .iscrda[idaa + 1], &ry[n - 1]);
 
	}
 

	dascr_ .rscrri[99] = (float)0.;
	dacon_(&sx, & dascr_ .rscrri[99]);
 

	dascr_ .rscrri[99] = (float)0.;
	dacon_(&sy, & dascr_ .rscrri[99]);
	for (n = nc; n >= 1; --n) {
 

	    daadd_(&sx, &xl, & dascr_ .iscrda[idaa]);
	    dacop_(& dascr_ .iscrda[idaa], &saux);
 

	    dacop_(&rx[n - 1], & dascr_ .iscrda[idaa]);
	    dacop_(&ry[n - 1], & dascr_ .iscrda[idaa + 1]);
	    damul_(& dascr_ .iscrda[idaa], &saux, & dascr_ .iscrda[idaa + 2]);
	    damul_(& dascr_ .iscrda[idaa + 1], &sy, & dascr_ .iscrda[idaa + 3]);
	    dasub_(& dascr_ .iscrda[idaa + 2], & dascr_ .iscrda[idaa + 3], &
		    dascr_ .iscrda[idaa + 4]);
	    dacop_(& dascr_ .iscrda[idaa + 4], &sx);
 

	    dacop_(&rx[n - 1], & dascr_ .iscrda[idaa]);
	    dacop_(&ry[n - 1], & dascr_ .iscrda[idaa + 1]);
	    damul_(& dascr_ .iscrda[idaa], &sy, & dascr_ .iscrda[idaa + 2]);
	    damul_(& dascr_ .iscrda[idaa + 1], &saux, & dascr_ .iscrda[idaa + 3]
		    );
	    daadd_(& dascr_ .iscrda[idaa + 2], & dascr_ .iscrda[idaa + 3], &
		    dascr_ .iscrda[idaa + 4]);
	    dacop_(& dascr_ .iscrda[idaa + 4], &sy);
 

	    damul_(&h__, &xl, & dascr_ .iscrda[idaa]);
	    dacop_(& dascr_ .iscrda[idaa], &xl);
 
	}
 

	dacmu_(&sx, &c_b2869, & dascr_ .iscrda[idaa]);
	dacop_(& dascr_ .iscrda[idaa], wx);
 

	dacmu_(&sy, &c_b2869, & dascr_ .iscrda[idaa]);
	dacop_(& dascr_ .iscrda[idaa], wy);
    } else {
 

	dacop_(&y, &xh);
 

	dacop_(&x, &yh);
 

	dascr_ .rscrri[99] = (float)0.;
	dacon_(rx, & dascr_ .rscrri[99]);
 

	dascr_ .rscrri[99] = (float)0.;
	dacon_(ry, & dascr_ .rscrri[99]);
	for (n = 9; n >= 1; --n) {
 

	    dacop_(rx, & dascr_ .iscrda[idaa]);
	    d__1 = n * 1.;
	    dacmu_(& dascr_ .iscrda[idaa], &d__1, & dascr_ .iscrda[idaa + 1]);
	    daadd_(&xh, & dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa + 2]);
	    dacop_(& dascr_ .iscrda[idaa + 2], &tx);
 

	    dacop_(ry, & dascr_ .iscrda[idaa]);
	    d__1 = n * 1.;
	    dacmu_(& dascr_ .iscrda[idaa], &d__1, & dascr_ .iscrda[idaa + 1]);
	    dasub_(&yh, & dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa + 2]);
	    dacop_(& dascr_ .iscrda[idaa + 2], &ty);
 

	    damul_(&tx, &tx, & dascr_ .iscrda[idaa]);
	    damul_(&ty, &ty, & dascr_ .iscrda[idaa + 1]);
	    daadd_(& dascr_ .iscrda[idaa], & dascr_ .iscrda[idaa + 1], &
		    dascr_ .iscrda[idaa + 2]);
	    dacop_(& dascr_ .iscrda[idaa + 2], &tn);
 

	    dacmu_(&tx, &c_b461, & dascr_ .iscrda[idaa]);
	    dadiv_(& dascr_ .iscrda[idaa], &tn, & dascr_ .iscrda[idaa + 1]);
	    dacop_(& dascr_ .iscrda[idaa + 1], rx);
 

	    dacmu_(&ty, &c_b461, & dascr_ .iscrda[idaa]);
	    dadiv_(& dascr_ .iscrda[idaa], &tn, & dascr_ .iscrda[idaa + 1]);
	    dacop_(& dascr_ .iscrda[idaa + 1], ry);
 
	}
 

	dacop_(rx, & dascr_ .iscrda[idaa]);
	dacmu_(& dascr_ .iscrda[idaa], &c_b2869, & dascr_ .iscrda[idaa + 1]);
	dacop_(& dascr_ .iscrda[idaa + 1], wx);
 

	dacop_(ry, & dascr_ .iscrda[idaa]);
	dacmu_(& dascr_ .iscrda[idaa], &c_b2869, & dascr_ .iscrda[idaa + 1]);
	dacop_(& dascr_ .iscrda[idaa + 1], wy);
    }
    if (dare_(&y) == (float)0.) {
 

	dacmu_(&x, &c_b2381, & dascr_ .iscrda[idaa]);
	damul_(& dascr_ .iscrda[idaa], &x, & dascr_ .iscrda[idaa + 1]);
	dafun_("EXP   ", & dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[idaa + 2],
		 6L);
	dacop_(& dascr_ .iscrda[idaa + 2], wx);
    }
    if (dare_(yy) < (float)0.) {
 

	damul_(&y, &y, & dascr_ .iscrda[idaa]);
	damul_(&x, &x, & dascr_ .iscrda[idaa + 1]);
	dacmu_(&x, &c_b2400, & dascr_ .iscrda[idaa + 2]);
	damul_(& dascr_ .iscrda[idaa + 2], &y, & dascr_ .iscrda[idaa + 3]);
	dasub_(& dascr_ .iscrda[idaa], & dascr_ .iscrda[idaa + 1], &
		dascr_ .iscrda[idaa + 4]);
	dafun_("EXP   ", & dascr_ .iscrda[idaa + 4], & dascr_ .iscrda[idaa + 5],
		 6L);
	dafun_("COS   ", & dascr_ .iscrda[idaa + 3], & dascr_ .iscrda[idaa + 6],
		 6L);
	dacmu_(& dascr_ .iscrda[idaa + 5], &c_b2400, & dascr_ .iscrda[idaa + 7])
		;
	damul_(& dascr_ .iscrda[idaa + 7], & dascr_ .iscrda[idaa + 6], &
		dascr_ .iscrda[idaa + 8]);
	dasub_(& dascr_ .iscrda[idaa + 8], wx, & dascr_ .iscrda[idaa + 9]);
	dacop_(& dascr_ .iscrda[idaa + 9], wx);
 

	damul_(&y, &y, & dascr_ .iscrda[idaa]);
	damul_(&x, &x, & dascr_ .iscrda[idaa + 1]);
	dacmu_(&x, &c_b2400, & dascr_ .iscrda[idaa + 2]);
	damul_(& dascr_ .iscrda[idaa + 2], &y, & dascr_ .iscrda[idaa + 3]);
	dasub_(& dascr_ .iscrda[idaa], & dascr_ .iscrda[idaa + 1], &
		dascr_ .iscrda[idaa + 4]);
	dafun_("EXP   ", & dascr_ .iscrda[idaa + 4], & dascr_ .iscrda[idaa + 5],
		 6L);
	dafun_("SIN   ", & dascr_ .iscrda[idaa + 3], & dascr_ .iscrda[idaa + 6],
		 6L);
	dascr_ .rscrri[idaa + 7] = -2.;
	d__1 = dascr_ .rscrri[idaa + 7] * 1.;
	dacmu_(& dascr_ .iscrda[idaa + 5], &d__1, & dascr_ .iscrda[idaa + 8]);
	damul_(& dascr_ .iscrda[idaa + 8], & dascr_ .iscrda[idaa + 6], &
		dascr_ .iscrda[idaa + 9]);
	dasub_(& dascr_ .iscrda[idaa + 9], wy, & dascr_ .iscrda[idaa + 10]);
	dacop_(& dascr_ .iscrda[idaa + 10], wy);
	if (dare_(xx) > (float)0.) {
 

	    dacmu_(wy, &c_b2381, & dascr_ .iscrda[idaa]);
	    dacop_(& dascr_ .iscrda[idaa], wy);
	}
    } else {
	if (dare_(xx) < (float)0.) {
 

	    dacmu_(wy, &c_b2381, & dascr_ .iscrda[idaa]);
	    dacop_(& dascr_ .iscrda[idaa], wy);
	}
    }
    if (dial_ .idalloc == 2 && *ix == beam_ .nbeam) {
	dadal_(&xl, &c__1);
	dadal_(&sy, &c__1);
	dadal_(&sx, &c__1);
	dadal_(&saux, &c__1);
	dadal_(&ty, &c__1);
	dadal_(&tn, &c__1);
	dadal_(&tx, &c__1);
	dadal_(ry, &c__33);
	dadal_(rx, &c__33);
	dadal_(&yh, &c__1);
	dadal_(&xh, &c__1);
	dadal_(&h__, &c__1);
	dadal_(&q, &c__1);
	dadal_(&y, &c__1);
	dadal_(&x, &c__1);
 
    }
}  

 
 
  int error_(ier)
integer *ier;
{
     
    static char fmt_10000[] = "(5x///t10,\002++++++++++++++++++++++++\002/t10,\002+++++ERROR DETECTED+++++\002/t10,\002++++++++++++++++++++++++\002/t10,\002RUN TERMINATED ABNORMALLY !!!\002//)";
    static char fmt_10010[] = "(t10,\002WRONG MODE DEFINITION\002)";
    static char fmt_10020[] = "(t10,\002NOT MORE THAN: \002,i4,\002 POSITIONS FOR RESONANCE-COMPEN\002,\002SATION ALLOWED\002)";
    static char fmt_10030[] = "(t10,\002ELEMENT FOR RESONANCE-COMPENSATION IS NOT IN THE ELE\002,\002MENTLIST\002)";
    static char fmt_10040[] = "(t10,\002UNSTABLE CLOSED ORBIT DURING INITIAL DISPERSION\002,\002 CALCULATION\002/t10,\002INSTABILITY OCCURED FOR SMALL RELATIVE ENERGY DEVIATION\002)";
    static char fmt_10050[] = "(t10,\002UNSTABLE CLOSED ORBIT FOR ZERO ENERGY DEVIATION\002)";
    static char fmt_10060[] = "(t10,\002UNSTABLE CLOSED ORBIT DURING DISPERSION CALCULATION\002,\002 AFTER ORBIT SCALING\002/t10,\002INSTABILITY OCCURED FOR SMALL RELATIVE ENERGY DEVIATION\002)";
    static char fmt_10070[] = "(t10,\002UNSTABLE CLOSED ORBIT AFTER ORBIT SCALING\002)";
    static char fmt_10080[] = "(t10,\002ELEMENTS SPECIFIED FOR TUNE VARIATION ARE NOT\002,\002 QUADRUPOLES\002)";
    static char fmt_10090[] = "(t10,\002UNSTABLE CLOSED ORBIT DURING TUNE VARIATION\002)";
    static char fmt_10100[] = "(t10,\002NO OPTICAL SOLUTION DURING TUNE VARIATION\002)";
    static char fmt_10110[] = "(t10,\002ELEMENTS SPECIFIED FOR CHROMATICITY CORRECTION ARE\002,\002 NOT SEXTUPOLES\002)";
    static char fmt_10120[] = "(t10,\002UNSTABLE CLOSED ORBIT DURING CHROMATICITY CORRECTION\002)";
    static char fmt_10130[] = "(t10,\002NO OPTICAL SOLUTION DURING CHROMATICITY CORRECTION\002)";
    static char fmt_10140[] = "(t10,\002ELEMENTS OF DIFFERENT TYPES ARE COMBINED IN DATA\002,\002 BLOCK COMBINATION OF ELEMENTS\002)";
    static char fmt_10150[] = "(t10,\002UNKNOWN BLOCK SPECIFICATION\002)";
    static char fmt_10160[] = "(t10,\002NO. OF SINGLE ELEMENTS EXCEEDS THE MAXIMUM ALLOWED\002,\002 VALUE: \002,i4)";
    static char fmt_10170[] = "(t10,\002NO. OF SUPERPERIODS LARGER THAN : \002,i4)";
    static char fmt_10180[] = "(t10,\002NO. OF DIFFERENT BLOCKS EXCEEDS THE MAXIMUM ALLOWED\002,\002 VALUE: \002,i5)";
    static char fmt_10190[] = "(t10,\002UNKNOWN SINGLE ELEMENT : \002,a16,\002 IN THE BLOCK DEFINITION\002)";
    static char fmt_10200[] = "(t10,\002UNKNOWN BLOCK NAME OR INSERTION NAME : \002,a16,\002 IN THE\002,\002 STRUCTURE INPUT\002)";
    static char fmt_10210[] = "(t10,\002MAXIMUM NUMBER OF STRUCTURE ELEMENTS SURPASSED\002)";
    static char fmt_10220[] = "(t10,\002NO SOLUTION FOR ORBIT SCALING - POSSIBLE REASONS:\002/t10,\002--> DIPOLE STRENGTHS OF NON-CORRECTOR ELEMENTS TO HIGH\002/t10,\002--> NONLINEARITIES TOO STRONG, TRY TO INCREASE INITIAL\002/t10,\002    CORRECTOR STRENGTHS\002/t10,\002--> USE ALL DIPOLE ELEMENTS FOR SCALING\002/)";
    static char fmt_10230[] = "(t10,\002NO OPTICAL SOLUTION\002)";
    static char fmt_10240[] = "(t10,\002NO SOLUTION FOR DISPERSION\002)";
    static char fmt_10250[] = "(t10,\002--> PLEASE INCLUDE LENGTH OF MACHINE IN THE\002,\002 <SYNCHROTRON>-BLOCK\002)";
    static char fmt_10260[] = "(t10,\002ONE BLOCK CAN NOT HAVE MORE THAN \002,i4,\002 ELEMENTS\002)";
    static char fmt_10270[] = "(t10,\002KINETIC ENERGY OF THE PARTICLE IS LESS OR EQUAL ZERO\002)";
    static char fmt_10280[] = "(t10,\002EITHER YOUR RF-FREQENCY IS SHIFTED BY 180 DEGREES\002/,t10,\002THEN CHANGE THE SIGN OF <ITION> IN THE \002,\002<SYNCHROTRON>-INPUTBLOCK\002,/t10,\002OR YOUR ALFA-P IS WRONGLY \002,\002INTRODUCED IN THE SAME INPUTBLOCK\002)";
    static char fmt_10290[] = "(t10,\002MULTIPOLECOEFFITIONS CANNOT BE SET EQUAL\002)";
    static char fmt_10300[] = "(t10,\002THE RANDOM NUMBER: \002,i6,\002 FOR THE INITIAL\002,\002 STRUCTURE IS TOO SMALL\002)";
    static char fmt_10310[] = "(t10,\002ELEMENTS THAT NEED RANDOM NUMBERS HAVE A KZ > 0\002)";
    static char fmt_10320[] = "(t10,\002THERE ARE NOT ENOUGH RANDOM NUMBERS FOR THE INSERTED\002,\002 ELEMENTS\002)";
    static char fmt_10330[] = "(t10,\002TO USE THE SAME RANDOMNUMBERS FOR 2 ELEMENTS, THE\002,\002 INSERTED ELEMENT MUST NOT NEED MORE OF SUCH NUMBERS THAN THE\002,\002 REFERENCE ELEMENT\002)";
    static char fmt_10340[] = "(t10,\002NOT MORE THAN\002,i4,\002 OF EACH TYP OF INSERTED ELEMENTS\002,\002 CAN BE USED\002)";
    static char fmt_10350[] = "(t10,\002PROBLEMS DURING MATRIX-INVERSION IN QMOD\002)";
    static char fmt_10360[] = "(t10,\002NO CONVERGENCE IN RMOD\002)";
    static char fmt_10370[] = "(t10,\002CHOSEN ORDERS OF RESONANCES CAN NOT BE CALCULATED\002)";
    static char fmt_10380[] = "(t10,\002PROBLEMS DURING MATRIX-INVERSION IN RMOD\002)";
    static char fmt_10390[] = "(t10,\002WITH THE SPECIFIED ELEMENTS THE RESONANCE CANNOT BE\002,\002 COMPENSATED - RESONANCEORDER AND ELEMENTTYP # MUST BE THE SAME\002)";
    static char fmt_10400[] = "(t10,\002NOT MORE THAN 2 PARTICLES CAN BE TRACKED\002)";
    static char fmt_10410[] = "(t10,\002GEOMETRY AND STRENGTH FILE (UNIT 2) IS EMPTY OR \002,\002 DISTROYED\002)";
    static char fmt_10420[] = "(t10,\002TRACKING PARAMETER FILE (UNIT 3) IS EMPTY OR \002,\002 NONEXISTING\002)";
    static char fmt_10430[] = "(t10,\002NOT MORE THAN \002,i4,\002 RANDOM NUMBERS CAN BE USED\002)";
    static char fmt_10440[] = "(t10,\002FOR THE INPUTBLOCK - ORBIT CORRECTION - ONLY CORRE\002,\002CTORS WITH THE KEYWORDS ( HCOR= ; VCOR= )\002/t10,\002AND MONITORS WITH THE\002,\002 KEYWORDS ( HMON= ; VMON= ) ARE ALLOWED\002)";
    static char fmt_10450[] = "(t10,\002FOR THE INPUTBLOCK - LINEAR OPTICS - ONLY\002,\002 THE KEYWORD ( ELEMENT ) AND ( BLOCK ) ARE ALLOWED\002)";
    static char fmt_10460[] = "(t10,\002ORDER OF COMPENSATION CAN NOT BE LARGER THAN : \002,i4)";
    static char fmt_10470[] = "(t10,\002ONLY UP TO 3 RESONANCES CAN BE COMPENSATED\002)";
    static char fmt_10480[] = "(t10,\002RESONANCE TYPE IS OUT OF THE RANGE OF THE RESONANCE\002,\002 ORDER\002)";
    static char fmt_10490[] = "(t10,\002ONLY UP TO 3 SUBRESONANCES CAN BE COMPENSATED\002)";
    static char fmt_10500[] = "(t10,\002THE MULTIPOLE ORDER FOR THE SUBRESONANCE COMPENSATION\002,\002 SHOULD NOT EXCEED THE VALUE 9\002)";
    static char fmt_10510[] = "(t10,\002TOO MANY RIPPLE ELEMENTS\002)";
    static char fmt_10520[] = "(t10,\002MAXIMUM ORDER OF THE ONE TURN MAP IS \002,i4,/,\002 NEMA HAS TO BE LARGER THAN NORD\002)";
    static char fmt_10530[] = "(t10,\002# OF VARIABLES -NV- OF THE ONE TURN MAP IS NOT\002,\002 IN THE ALLOWED RANGE [2 <= NV <= 5]\002)";
    static char fmt_10540[] = "(t10,\002MAXIMUM NUMBER OF PARTICLES FOR VECTORIZATION\002,\002 IS \002,i4)";
    static char fmt_10550[] = "(t10,\002MAXIMUM NUMBER OF DIFFERENT SEEDS FOR VECTORIZATION\002,\002 IS \002,i4)";
    static char fmt_10560[] = "(t10,\002PROBLEMS WITH FILE 13 WITH INITIAL COORDINATES \002,\002 - ERROR CODE : \002,i10)";
    static char fmt_10570[] = "(t10,\002PROBLEMS WITH FILE 2 WITH ACCELERATOR STRUCTURE \002,\002 - ERROR CODE : \002,i10)";
    static char fmt_10580[] = "(t10,\002PROBLEMS WITH FILE 3 WITH TRACKING PARAMETERS \002,\002 - ERROR CODE : \002,i10)";
    static char fmt_10590[] = "(t10,\002PROBLEMS WITH FILE 11 FOR DATEN LIST INPUT \002,\002 - ERROR CODE : \002,i10)";
    static char fmt_10600[] = "(t10,\002PROBLEMS WITH FILE 99 FOR BINARY OUTPUT \002,\002 - ERROR CODE : \002,i10)";
    static char fmt_10610[] = "(t10,\002PROBLEMS WITH FILE 12 FOR END COORDINATES\002,\002 - ERROR CODE : \002,i10)";
    static char fmt_10620[] = "(t10,\002ELEMENTS SPECIFIED FOR DECOUPLING ARE NOT\002,\002 SKEW QUADRUPOLES\002)";
    static char fmt_10630[] = "(t10,\002THERE ARE THE APPROPRIATE ELEMENTS FOR\002,\002 THE DECOUPLING OR SIMULTANEOUS TUNE ADJUSTMENT\002)";
    static char fmt_10640[] = "(t10,\002PROBLEMS DURING MATRIX-INVERSION IN DECOUP\002)";
    static char fmt_10650[] = "(t10,\002MAXIMUM NUMBER OF EXTRA PARAMETERS IS : \002,i4)";
    static char fmt_10660[] = "(t10,\002EXTRA PARAMETERS FOR THE MAP DOES NOT EXIST\002)";
    static char fmt_10670[] = "(t10,\002ONLY SINGLE KICK ELEMENTS ALLOWED FOR MAP CALCULATION\002)";
    static char fmt_10680[] = "(t10,\002THE ORDER OF THE NORMAL FORM IS TOO HIGH. CHECK THE\002,\002 DIFFERENTIAL ALGEBRA PARAMETERS\002)";
    static char fmt_10690[] = "(t10,\002TOO MANY VARIABLES SPECIFIED. CHECK THE DIFFERENTIAL\002,\002 ALGEBRA PARAMETERS\002)";
    static char fmt_10700[] = "(t10,\002NO CORRECTORS SPECIFIED\002)";
    static char fmt_10710[] = "(t10,\002BOTH AMPLITUDE AND MOMENTUM ORDER ARE ZERO!\002)";
    static char fmt_10720[] = "(t10,\002BOTH AMPLITUDE AND MOMENTUM ORDER ARE DIFFERENT FROM\002,\002 ZERO!\002)";
    static char fmt_10730[] = "(t10,\002AMPLITUDE ORDER OUTSIDE RANGE [0,2]\002)";
    static char fmt_10740[] = "(t10,\002MOMENTUM ORDER OUTSIDE RANGE [0,3] (ONE EXCLUDED!)\002)";
    static char fmt_10750[] = "(t10,\002MINIMUM ORDER OUTSIDE RANGE [2,3]\002)";
    static char fmt_10760[] = "(t10,\002MINIMUM ORDER GREATER THAN MAXIMUM!\002)";
    static char fmt_10770[] = "(t10,\002MAXIMUM ORDER OUTSIDE RANGE [2,3]\002)";
    static char fmt_10780[] = "(t10,\002NORMAL FORMS ANALYSIS IMPOSSIBLE\002,/,t10,\002THE TRANSFER MAP DOES NOT EXIST!\002)";
    static char fmt_10790[] = "(t10,\002ZERO OR NEGATIVE ENERGY DOES NOT MAKE MUCH SENSE\002)";
    static char fmt_10800[] = "(t10,\002PROBLEM READING EXTERNAL MULTIPOLE ERRORS\002)";
    static char fmt_10810[] = "(t10,\002TOO MANY ELEMENTS FOR LINEAR OPTICS WRITE-OUT\002)";
    static char fmt_10820[] = "(t10,\002FOR CLOSED ORBIT CORRECTORS ONLY DIPOLES OF LEGTH\002,\002 ZERO OR MULTIPOLE LENSES ALLOWED\002)";
    static char fmt_10830[] = "(t10,\002AN ELEMENT FOR CLOSED ORBIT CORRECTION CAN BE ONLY\002,\002 EITHER A HORIZONTAL MONITOR\002,/,t10,\002OR A VERTICAL MONITOR OR\002,\002 A HORIZONTAL CORRECTOR OR A VERTICAL CORRECTOR\002)";
    static char fmt_10840[] = "(t10,\002NUMBER OF ORBIT CORRECTORS IS ZERO\002)";
    static char fmt_10850[] = "(t10,\002THE ORDER OF MULTIPOLES MMUL: \002,i4,\002 HAS TO BE LARGER\002,\002 THAN 10 BUT SMALLER THAN 20\002)";
    static char fmt_10860[] = "(t10,\002PROBLEM READING EXTERNAL MISALIGNMENTS\002)";
    static char fmt_10870[] = "(t10,\002PROBLEM READING FROM FILE 30 (SINGLE KICKS AND \002,\002MISALIGNMENTS\002)";
    static char fmt_10880[] = "(t10,\002BEAM_BEAM: EITHER NORMALIZED EMITTANCES OR THE \002,\002RESULTING SIGMA VALUES EQUAL TO ZERO\002)";
    static char fmt_10890[] = "(t10,\002BEAM_BEAM: AT EACH INTERACTION POINT THE BEAM \002,\002MUST BE EITHER ROUND OR ELLIPTICAL FOR ALL PARTICLES\002)";
    static char fmt_10900[] = "(t10,\002QUADRUPOLES ARE NOT SUITED TO ADJUST THE 6D TUNES\002)";
    static char fmt_10910[] = "(t10,\002ORDER AND NUMBER OF VARIABLES HAVE TO BE LARGER \002,\002THAN ZERO TO CALCULATE A DIFFEREENTIAL ALGEBRA MAP\002)";
    static char fmt_10920[] = "(t10,\002YOU CANNOT COMBINE AN ELEMENT WITH ITSELF\002)";
    static char fmt_10930[] = "(t10,\002INVERTED LINEAR BLOCKS NOT ALLOWED\002)";

     
    integer s_wsfe(), e_wsfe(), do_fio();
      int s_stop();

     
    static cilist io___1097 = { 0, 6, 0, fmt_10000, 0 };
    static cilist io___1098 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___1099 = { 0, 6, 0, fmt_10020, 0 };
    static cilist io___1100 = { 0, 6, 0, fmt_10030, 0 };
    static cilist io___1101 = { 0, 6, 0, fmt_10040, 0 };
    static cilist io___1102 = { 0, 6, 0, fmt_10050, 0 };
    static cilist io___1103 = { 0, 6, 0, fmt_10060, 0 };
    static cilist io___1104 = { 0, 6, 0, fmt_10070, 0 };
    static cilist io___1105 = { 0, 6, 0, fmt_10080, 0 };
    static cilist io___1106 = { 0, 6, 0, fmt_10090, 0 };
    static cilist io___1107 = { 0, 6, 0, fmt_10100, 0 };
    static cilist io___1108 = { 0, 6, 0, fmt_10110, 0 };
    static cilist io___1109 = { 0, 6, 0, fmt_10120, 0 };
    static cilist io___1110 = { 0, 6, 0, fmt_10130, 0 };
    static cilist io___1111 = { 0, 6, 0, fmt_10140, 0 };
    static cilist io___1112 = { 0, 6, 0, fmt_10150, 0 };
    static cilist io___1113 = { 0, 6, 0, fmt_10160, 0 };
    static cilist io___1114 = { 0, 6, 0, fmt_10170, 0 };
    static cilist io___1115 = { 0, 6, 0, fmt_10180, 0 };
    static cilist io___1116 = { 0, 6, 0, fmt_10190, 0 };
    static cilist io___1117 = { 0, 6, 0, fmt_10200, 0 };
    static cilist io___1118 = { 0, 6, 0, fmt_10210, 0 };
    static cilist io___1119 = { 0, 6, 0, fmt_10220, 0 };
    static cilist io___1120 = { 0, 6, 0, fmt_10230, 0 };
    static cilist io___1121 = { 0, 6, 0, fmt_10240, 0 };
    static cilist io___1122 = { 0, 6, 0, fmt_10250, 0 };
    static cilist io___1123 = { 0, 6, 0, fmt_10260, 0 };
    static cilist io___1124 = { 0, 6, 0, fmt_10270, 0 };
    static cilist io___1125 = { 0, 6, 0, fmt_10280, 0 };
    static cilist io___1126 = { 0, 6, 0, fmt_10290, 0 };
    static cilist io___1127 = { 0, 6, 0, fmt_10300, 0 };
    static cilist io___1128 = { 0, 6, 0, fmt_10310, 0 };
    static cilist io___1129 = { 0, 6, 0, fmt_10320, 0 };
    static cilist io___1130 = { 0, 6, 0, fmt_10330, 0 };
    static cilist io___1131 = { 0, 6, 0, fmt_10340, 0 };
    static cilist io___1132 = { 0, 6, 0, fmt_10350, 0 };
    static cilist io___1133 = { 0, 6, 0, fmt_10360, 0 };
    static cilist io___1134 = { 0, 6, 0, fmt_10370, 0 };
    static cilist io___1135 = { 0, 6, 0, fmt_10380, 0 };
    static cilist io___1136 = { 0, 6, 0, fmt_10390, 0 };
    static cilist io___1137 = { 0, 6, 0, fmt_10400, 0 };
    static cilist io___1138 = { 0, 6, 0, fmt_10410, 0 };
    static cilist io___1139 = { 0, 6, 0, fmt_10420, 0 };
    static cilist io___1140 = { 0, 6, 0, fmt_10430, 0 };
    static cilist io___1141 = { 0, 6, 0, fmt_10440, 0 };
    static cilist io___1142 = { 0, 6, 0, fmt_10450, 0 };
    static cilist io___1143 = { 0, 6, 0, fmt_10460, 0 };
    static cilist io___1144 = { 0, 6, 0, fmt_10470, 0 };
    static cilist io___1145 = { 0, 6, 0, fmt_10480, 0 };
    static cilist io___1146 = { 0, 6, 0, fmt_10490, 0 };
    static cilist io___1147 = { 0, 6, 0, fmt_10500, 0 };
    static cilist io___1148 = { 0, 6, 0, fmt_10510, 0 };
    static cilist io___1149 = { 0, 6, 0, fmt_10520, 0 };
    static cilist io___1150 = { 0, 6, 0, fmt_10530, 0 };
    static cilist io___1151 = { 0, 6, 0, fmt_10540, 0 };
    static cilist io___1152 = { 0, 6, 0, fmt_10550, 0 };
    static cilist io___1153 = { 0, 6, 0, fmt_10560, 0 };
    static cilist io___1154 = { 0, 6, 0, fmt_10570, 0 };
    static cilist io___1155 = { 0, 6, 0, fmt_10580, 0 };
    static cilist io___1156 = { 0, 6, 0, fmt_10590, 0 };
    static cilist io___1157 = { 0, 6, 0, fmt_10600, 0 };
    static cilist io___1158 = { 0, 6, 0, fmt_10610, 0 };
    static cilist io___1159 = { 0, 6, 0, fmt_10620, 0 };
    static cilist io___1160 = { 0, 6, 0, fmt_10630, 0 };
    static cilist io___1161 = { 0, 6, 0, fmt_10640, 0 };
    static cilist io___1162 = { 0, 6, 0, fmt_10650, 0 };
    static cilist io___1163 = { 0, 6, 0, fmt_10660, 0 };
    static cilist io___1164 = { 0, 6, 0, fmt_10670, 0 };
    static cilist io___1165 = { 0, 6, 0, fmt_10680, 0 };
    static cilist io___1166 = { 0, 6, 0, fmt_10690, 0 };
    static cilist io___1167 = { 0, 6, 0, fmt_10700, 0 };
    static cilist io___1168 = { 0, 6, 0, fmt_10710, 0 };
    static cilist io___1169 = { 0, 6, 0, fmt_10720, 0 };
    static cilist io___1170 = { 0, 6, 0, fmt_10730, 0 };
    static cilist io___1171 = { 0, 6, 0, fmt_10740, 0 };
    static cilist io___1172 = { 0, 6, 0, fmt_10750, 0 };
    static cilist io___1173 = { 0, 6, 0, fmt_10760, 0 };
    static cilist io___1174 = { 0, 6, 0, fmt_10770, 0 };
    static cilist io___1175 = { 0, 6, 0, fmt_10780, 0 };
    static cilist io___1176 = { 0, 6, 0, fmt_10790, 0 };
    static cilist io___1177 = { 0, 6, 0, fmt_10800, 0 };
    static cilist io___1178 = { 0, 6, 0, fmt_10810, 0 };
    static cilist io___1179 = { 0, 6, 0, fmt_10820, 0 };
    static cilist io___1180 = { 0, 6, 0, fmt_10830, 0 };
    static cilist io___1181 = { 0, 6, 0, fmt_10840, 0 };
    static cilist io___1182 = { 0, 6, 0, fmt_10850, 0 };
    static cilist io___1183 = { 0, 6, 0, fmt_10860, 0 };
    static cilist io___1184 = { 0, 6, 0, fmt_10870, 0 };
    static cilist io___1185 = { 0, 6, 0, fmt_10880, 0 };
    static cilist io___1186 = { 0, 6, 0, fmt_10890, 0 };
    static cilist io___1187 = { 0, 6, 0, fmt_10900, 0 };
    static cilist io___1188 = { 0, 6, 0, fmt_10910, 0 };
    static cilist io___1189 = { 0, 6, 0, fmt_10920, 0 };
    static cilist io___1190 = { 0, 6, 0, fmt_10930, 0 };


 

 
 

    s_wsfe(&io___1097);
    e_wsfe();
    switch ((int)*ier) {
	case 1:  goto L10;
	case 2:  goto L20;
	case 3:  goto L30;
	case 4:  goto L40;
	case 5:  goto L50;
	case 6:  goto L60;
	case 7:  goto L70;
	case 8:  goto L80;
	case 9:  goto L90;
	case 10:  goto L100;
	case 11:  goto L110;
	case 12:  goto L120;
	case 13:  goto L130;
	case 14:  goto L140;
	case 15:  goto L150;
	case 16:  goto L160;
	case 17:  goto L170;
	case 18:  goto L180;
	case 19:  goto L190;
	case 20:  goto L200;
	case 21:  goto L210;
	case 22:  goto L220;
	case 23:  goto L230;
	case 24:  goto L240;
	case 25:  goto L250;
	case 26:  goto L260;
	case 27:  goto L270;
	case 28:  goto L280;
	case 29:  goto L290;
	case 30:  goto L300;
	case 31:  goto L310;
	case 32:  goto L320;
	case 33:  goto L330;
	case 34:  goto L340;
	case 35:  goto L350;
	case 36:  goto L360;
	case 37:  goto L370;
	case 38:  goto L380;
	case 39:  goto L390;
	case 40:  goto L400;
	case 41:  goto L410;
	case 42:  goto L420;
	case 43:  goto L430;
	case 44:  goto L440;
	case 45:  goto L450;
	case 46:  goto L460;
	case 47:  goto L470;
	case 48:  goto L480;
	case 49:  goto L490;
	case 50:  goto L500;
	case 51:  goto L510;
	case 52:  goto L520;
	case 53:  goto L530;
	case 54:  goto L540;
	case 55:  goto L550;
	case 56:  goto L560;
	case 57:  goto L570;
	case 58:  goto L580;
	case 59:  goto L590;
	case 60:  goto L600;
	case 61:  goto L610;
	case 62:  goto L620;
	case 63:  goto L630;
	case 64:  goto L640;
	case 65:  goto L650;
	case 66:  goto L660;
	case 67:  goto L670;
	case 68:  goto L680;
	case 69:  goto L690;
	case 70:  goto L700;
	case 71:  goto L710;
	case 72:  goto L720;
	case 73:  goto L730;
	case 74:  goto L740;
	case 75:  goto L750;
	case 76:  goto L760;
	case 77:  goto L770;
	case 78:  goto L780;
	case 79:  goto L790;
	case 80:  goto L800;
	case 81:  goto L810;
	case 82:  goto L820;
	case 83:  goto L830;
	case 84:  goto L840;
	case 85:  goto L850;
	case 86:  goto L860;
	case 87:  goto L870;
	case 88:  goto L880;
	case 89:  goto L890;
	case 90:  goto L900;
	case 91:  goto L910;
	case 92:  goto L920;
	case 93:  goto L930;
    }
L10:
    s_wsfe(&io___1098);
    e_wsfe();
    goto L1870;
L20:
    s_wsfe(&io___1099);
    do_fio(&c__1, (char *)&c__700, (ftnlen)sizeof(integer));
    e_wsfe();
    goto L1870;
L30:
    s_wsfe(&io___1100);
    e_wsfe();
    goto L1870;
L40:
    s_wsfe(&io___1101);
    e_wsfe();
    goto L1870;
L50:
    s_wsfe(&io___1102);
    e_wsfe();
    goto L1870;
L60:
    s_wsfe(&io___1103);
    e_wsfe();
    goto L1870;
L70:
    s_wsfe(&io___1104);
    e_wsfe();
    goto L1870;
L80:
    s_wsfe(&io___1105);
    e_wsfe();
    goto L1870;
L90:
    s_wsfe(&io___1106);
    e_wsfe();
    goto L1870;
L100:
    s_wsfe(&io___1107);
    e_wsfe();
    goto L1870;
L110:
    s_wsfe(&io___1108);
    e_wsfe();
    goto L1870;
L120:
    s_wsfe(&io___1109);
    e_wsfe();
    goto L1870;
L130:
    s_wsfe(&io___1110);
    e_wsfe();
    goto L1870;
L140:
    s_wsfe(&io___1111);
    e_wsfe();
    goto L1870;
L150:
    s_wsfe(&io___1112);
    e_wsfe();
    goto L1870;
L160:
    s_wsfe(&io___1113);
    do_fio(&c__1, (char *)&c__700, (ftnlen)sizeof(integer));
    e_wsfe();
    goto L1870;
L170:
    s_wsfe(&io___1114);
    do_fio(&c__1, (char *)&c__16, (ftnlen)sizeof(integer));
    e_wsfe();
    goto L1870;
L180:
    s_wsfe(&io___1115);
    do_fio(&c__1, (char *)&c__300, (ftnlen)sizeof(integer));
    e_wsfe();
    goto L1870;
L190:
    s_wsfe(&io___1116);
    do_fio(&c__1, erroc_ .erbez, 16L);
    e_wsfe();
    goto L1870;
L200:
    s_wsfe(&io___1117);
    do_fio(&c__1, erroc_ .erbez, 16L);
    e_wsfe();
    goto L1870;
L210:
    s_wsfe(&io___1118);
    e_wsfe();
    goto L1870;
L220:
    s_wsfe(&io___1119);
    e_wsfe();
    goto L1870;
L230:
    s_wsfe(&io___1120);
    e_wsfe();
    goto L1870;
L240:
    s_wsfe(&io___1121);
    e_wsfe();
    goto L1870;
L250:
    s_wsfe(&io___1122);
    e_wsfe();
    goto L1870;
L260:
    s_wsfe(&io___1123);
    do_fio(&c__1, (char *)&c__100, (ftnlen)sizeof(integer));
    e_wsfe();
    goto L1870;
L270:
    s_wsfe(&io___1124);
    e_wsfe();
    goto L1870;
L280:
    s_wsfe(&io___1125);
    e_wsfe();
    goto L1870;
L290:
    s_wsfe(&io___1126);
    e_wsfe();
    goto L1870;
L300:
    s_wsfe(&io___1127);
    do_fio(&c__1, (char *)&c_b3071, (ftnlen)sizeof(integer));
    e_wsfe();
    goto L1870;
L310:
    s_wsfe(&io___1128);
    e_wsfe();
    goto L1870;
L320:
    s_wsfe(&io___1129);
    e_wsfe();
    goto L1870;
L330:
    s_wsfe(&io___1130);
    e_wsfe();
    goto L1870;
L340:
    s_wsfe(&io___1131);
    do_fio(&c__1, (char *)&c__500, (ftnlen)sizeof(integer));
    e_wsfe();
    goto L1870;
L350:
    s_wsfe(&io___1132);
    e_wsfe();
    goto L1870;
L360:
    s_wsfe(&io___1133);
    e_wsfe();
    goto L1870;
L370:
    s_wsfe(&io___1134);
    e_wsfe();
    goto L1870;
L380:
    s_wsfe(&io___1135);
    e_wsfe();
    goto L1870;
L390:
    s_wsfe(&io___1136);
    e_wsfe();
    goto L1870;
L400:
    s_wsfe(&io___1137);
    e_wsfe();
    goto L1870;
L410:
    s_wsfe(&io___1138);
    e_wsfe();
    goto L1870;
L420:
    s_wsfe(&io___1139);
    e_wsfe();
    goto L1870;
L430:
    s_wsfe(&io___1140);
    do_fio(&c__1, (char *)&c_b1102, (ftnlen)sizeof(integer));
    e_wsfe();
    goto L1870;
L440:
    s_wsfe(&io___1141);
    e_wsfe();
    goto L1870;
L450:
    s_wsfe(&io___1142);
    e_wsfe();
    goto L1870;
L460:
    s_wsfe(&io___1143);
    do_fio(&c__1, (char *)&c__5, (ftnlen)sizeof(integer));
    e_wsfe();
    goto L1870;
L470:
    s_wsfe(&io___1144);
    e_wsfe();
    goto L1870;
L480:
    s_wsfe(&io___1145);
    e_wsfe();
    goto L1870;
L490:
    s_wsfe(&io___1146);
    e_wsfe();
    goto L1870;
L500:
    s_wsfe(&io___1147);
    e_wsfe();
    goto L1870;
L510:
    s_wsfe(&io___1148);
    e_wsfe();
    goto L1870;
L520:
    s_wsfe(&io___1149);
    do_fio(&c__1, (char *)&c__15, (ftnlen)sizeof(integer));
    e_wsfe();
    goto L1870;
L530:
    s_wsfe(&io___1150);
    e_wsfe();
    goto L1870;
L540:
    s_wsfe(&io___1151);
    do_fio(&c__1, (char *)&c__64, (ftnlen)sizeof(integer));
    e_wsfe();
    goto L1870;
L550:
    s_wsfe(&io___1152);
    do_fio(&c__1, (char *)&c__1, (ftnlen)sizeof(integer));
    e_wsfe();
    goto L1870;
L560:
    s_wsfe(&io___1153);
    do_fio(&c__1, (char *)& erro_ .ierro, (ftnlen)sizeof(integer));
    e_wsfe();
    goto L1870;
L570:
    s_wsfe(&io___1154);
    do_fio(&c__1, (char *)& erro_ .ierro, (ftnlen)sizeof(integer));
    e_wsfe();
    goto L1870;
L580:
    s_wsfe(&io___1155);
    do_fio(&c__1, (char *)& erro_ .ierro, (ftnlen)sizeof(integer));
    e_wsfe();
    goto L1870;
L590:
    s_wsfe(&io___1156);
    do_fio(&c__1, (char *)& erro_ .ierro, (ftnlen)sizeof(integer));
    e_wsfe();
    goto L1870;
L600:
    s_wsfe(&io___1157);
    do_fio(&c__1, (char *)& erro_ .ierro, (ftnlen)sizeof(integer));
    e_wsfe();
    goto L1870;
L610:
    s_wsfe(&io___1158);
    do_fio(&c__1, (char *)& erro_ .ierro, (ftnlen)sizeof(integer));
    e_wsfe();
    goto L1870;
L620:
    s_wsfe(&io___1159);
    e_wsfe();
    goto L1870;
L630:
    s_wsfe(&io___1160);
    e_wsfe();
    goto L1870;
L640:
    s_wsfe(&io___1161);
    e_wsfe();
    goto L1870;
L650:
    s_wsfe(&io___1162);
    do_fio(&c__1, (char *)&c__10, (ftnlen)sizeof(integer));
    e_wsfe();
    goto L1870;
L660:
    s_wsfe(&io___1163);
    e_wsfe();
    goto L1870;
L670:
    s_wsfe(&io___1164);
    e_wsfe();
    goto L1870;
L680:
    s_wsfe(&io___1165);
    e_wsfe();
    goto L1870;
L690:
    s_wsfe(&io___1166);
    e_wsfe();
    goto L1870;
L700:
    s_wsfe(&io___1167);
    e_wsfe();
    goto L1870;
L710:
    s_wsfe(&io___1168);
    e_wsfe();
    goto L1870;
L720:
    s_wsfe(&io___1169);
    e_wsfe();
    goto L1870;
L730:
    s_wsfe(&io___1170);
    e_wsfe();
    goto L1870;
L740:
    s_wsfe(&io___1171);
    e_wsfe();
    goto L1870;
L750:
    s_wsfe(&io___1172);
    e_wsfe();
    goto L1870;
L760:
    s_wsfe(&io___1173);
    e_wsfe();
    goto L1870;
L770:
    s_wsfe(&io___1174);
    e_wsfe();
    goto L1870;
L780:
    s_wsfe(&io___1175);
    e_wsfe();
    goto L1870;
L790:
    s_wsfe(&io___1176);
    e_wsfe();
    goto L1870;
L800:
    s_wsfe(&io___1177);
    e_wsfe();
    goto L1870;
L810:
    s_wsfe(&io___1178);
    e_wsfe();
    goto L1870;
L820:
    s_wsfe(&io___1179);
    e_wsfe();
    goto L1870;
L830:
    s_wsfe(&io___1180);
    e_wsfe();
    goto L1870;
L840:
    s_wsfe(&io___1181);
    e_wsfe();
    goto L1870;
L850:
    s_wsfe(&io___1182);
    do_fio(&c__1, (char *)&c__11, (ftnlen)sizeof(integer));
    e_wsfe();
    goto L1870;
L860:
    s_wsfe(&io___1183);
    e_wsfe();
    goto L1870;
L870:
    s_wsfe(&io___1184);
    e_wsfe();
    goto L1870;
L880:
    s_wsfe(&io___1185);
    e_wsfe();
    goto L1870;
L890:
    s_wsfe(&io___1186);
    e_wsfe();
    goto L1870;
L900:
    s_wsfe(&io___1187);
    e_wsfe();
    goto L1870;
L910:
    s_wsfe(&io___1188);
    e_wsfe();
    goto L1870;
L920:
    s_wsfe(&io___1189);
    e_wsfe();
    goto L1870;
L930:
    s_wsfe(&io___1190);
    e_wsfe();
L1870:
 

 

    s_stop("", 0L);
}  

 
  int fexpo6_(h__, x, v, nrmin, nrmax, sca, ifac)
integer *h__, *x, *v, *nrmin, *nrmax;
doublereal *sca;
integer *ifac;
{
     

    static integer bm = 0;
    static integer b0 = 0;

     
    integer i__1;

     
    static integer i__, j, non;
    extern   int lie6_(), take6_(), dadal_(), daall_(), dacop_(
	    ), dacmu_();

 
 
 
 

 


     
    --v;
    --x;

     

    daall_(&x[1], &c__12, "X         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&v[1], &c__12, "V         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(h__, &c__1, "H         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&bm, &c__1, "BM        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&b0, &c__1, "B0        ", & ii_ .no, & ii_ .nv, 10L);
 
    for (i__ = 1; i__ <= 6; ++i__) {
 
	dacop_(&x[i__], &v[i__]);
    }
 
    if (*nrmax == 2) {
	dadal_(&b0, &c__1);
	dadal_(&bm, &c__1);
	return 0;
    }

    if (*ifac == 100) {
	goto L60;
    }
 
    if (*ifac == 1) {
	i__1 = *nrmin;
	for (i__ = *nrmax; i__ >= i__1; --i__) {
	    take6_(h__, &i__, &b0);
	    dacmu_(&b0, sca, &bm);
	    for (j = 1; j <= 6; ++j) {
		non = ii_ .no;
		lie6_(&bm, &v[j], &b0, &i__, &non);
 
		dacop_(&b0, &v[j]);
	    }
 
	}
    } else {
 
	i__1 = *nrmax;
	for (i__ = *nrmin; i__ <= i__1; ++i__) {
	    take6_(h__, &i__, &b0);
	    dacmu_(&b0, sca, &bm);
	    for (j = 1; j <= 6; ++j) {
		non = ii_ .no;
		lie6_(&bm, &v[j], &b0, &i__, &non);
 
		dacop_(&b0, &v[j]);
	    }
 
	}
    }
    dadal_(&b0, &c__1);
    dadal_(&bm, &c__1);
    return 0;
 
L60:
    dacmu_(h__, sca, &bm);
    for (j = 1; j <= 6; ++j) {
	non = ii_ .no;
	lie6_(&bm, &v[j], &b0, nrmin, &non);
 
	dacop_(&b0, &v[j]);
    }
    dadal_(&b0, &c__1);
    dadal_(&bm, &c__1);
    return 0;
}  

 
 
  int fft_(ar, ai, m, n)
doublereal *ar, *ai;
integer *m, *n;
{
     
    integer i__1, i__2, i__3, i__4;

     
    integer pow_ii();
    double atan(), cos(), sin();

     
    static integer i__, j, k, l, le;
    static doublereal pi;
    static integer ip;
    static doublereal ti, ui, wi, tr, ur, wr;
    static integer le1, nm1, nv2;
    static doublereal uur;

 

 
 
 
 
 
 

 

 

     
    --ai;
    --ar;

     
    *n = pow_ii(&c__2, m);
    nv2 = *n / 2;
    nm1 = *n - 1;
    j = 1;
    i__1 = nm1;
    for (i__ = 1; i__ <= i__1; ++i__) {
	if (i__ > j) {
	    goto L10;
	}
	tr = ar[j];
	ti = ai[j];
	ar[j] = ar[i__];
	ai[j] = ai[i__];
	ar[i__] = tr;
	ai[i__] = ti;
L10:
	k = nv2;
L20:
	if (k >= j) {
	    goto L30;
	}
	j -= k;
	k /= 2;
	goto L20;
L30:
	j += k;
    }
    pi = atan(1.) * 4.;
    i__1 = *m;
    for (l = 1; l <= i__1; ++l) {
	le = pow_ii(&c__2, &l);
	le1 = le / 2;
	ur = 1.;
	ui = 0.;
	wr = cos(pi / le1);
	wi = -sin(pi / le1);
	i__2 = le1;
	for (j = 1; j <= i__2; ++j) {
	    i__3 = *n;
	    i__4 = le;
	    for (i__ = j; i__4 < 0 ? i__ >= i__3 : i__ <= i__3; i__ += i__4) {
		ip = i__ + le1;
 
 
		tr = ar[ip] * ur - ai[ip] * ui;
		ti = ar[ip] * ui + ai[ip] * ur;
		ar[ip] = ar[i__] - tr;
		ai[ip] = ai[i__] - ti;
		ar[i__] += tr;
		ai[i__] += ti;
 
	    }
 
 
	    uur = ur * wr - ui * wi;
	    ui = ur * wi + ui * wr;
	    ur = uur;
 
	}
    }
    i__2 = *n;
    for (i__ = 1; i__ <= i__2; ++i__) {
	ar[i__] = ar[i__] / *n * 2;
	ai[i__] = ai[i__] / *n * 2;
 
    }
    return 0;
}  

  int lfit_(x, y, l, key, a, b, e)
doublereal *x, *y;
integer *l, *key;
doublereal *a, *b, *e;
{
     
    integer i__1;

     
    static integer j;
    static doublereal xmed, ymed, sumx, sumy, count, sumxx, sumxy, sumyy, 
	    scartx, scarty;


 
 
 
 


 
     
    --y;
    --x;

     
    if (*l - 2 >= 0) {
	goto L1;
    } else {
	goto L25;
    }
L1:
    count = (float)0.;
    sumx = (float)0.;
    sumy = (float)0.;
    sumxy = (float)0.;
    sumxx = (float)0.;
    sumyy = (float)0.;
    i__1 = *l;
    for (j = 1; j <= i__1; ++j) {
	if (y[j] == (float)0. && *key == 0) {
	    goto L10;
	}
	sumx += x[j];
	sumy += y[j];
	count += (float)1.;
L10:
	;
    }
    if (count <= (float)1.) {
	goto L25;
    }
    ymed = sumy / count;
    xmed = sumx / count;
    i__1 = *l;
    for (j = 1; j <= i__1; ++j) {
	if (y[j] == (float)0. && *key == 0) {
	    goto L20;
	}
	scartx = x[j] - xmed;
	scarty = y[j] - ymed;
	sumxy += scartx * scarty;
	sumxx += scartx * scartx;
	sumyy += scarty * scarty;
L20:
	;
    }

 
    if (sumxx == (float)0.) {
	goto L25;
    }
    *a = sumxy / sumxx;
    *b = ymed - *a * xmed;
    if (count < (float)3.) {
	goto L101;
    }
    *e = (sumyy - sumxy * *a) / (count - (float)2.);
    goto L100;

 
L25:
    *a = (float)0.;
    *b = (float)0.;
L101:
    *e = (float)0.;
L100:
    return 0;
}  

  int lfitw_(x, y, w, l, key, a, b, e)
doublereal *x, *y, *w;
integer *l, *key;
doublereal *a, *b, *e;
{
     
    integer i__1;
    doublereal d__1, d__2, d__3;

     
    static integer j;
    static doublereal w2, ww, w2x, w2y, w2x2, w2y2, wwf, w2xy;
    static integer icnt;
    static doublereal wwfi;


 

 

 
 
 


 
     
    --w;
    --y;
    --x;

     
    if (*l <= 1) {
	goto L1;
    }
    w2 = (float)0.;
    w2x = (float)0.;
    w2y = (float)0.;
    w2xy = (float)0.;
    w2x2 = (float)0.;
    w2y2 = (float)0.;
    icnt = 0;
    i__1 = *l;
    for (j = 1; j <= i__1; ++j) {
	if (y[j] == (float)0. && *key == 0) {
	    goto L2;
	}
	ww = w[j] * w[j];
	w2 = ww + w2;
	wwf = ww * x[j];
	w2x = wwf + w2x;
	w2x2 = wwf * x[j] + w2x2;
	w2xy = wwf * y[j] + w2xy;
	wwfi = ww * y[j];
	w2y = wwfi + w2y;
	w2y2 = wwfi * y[j] + w2y2;
	++icnt;
L2:
	;
    }

 
 
    d__1 = w2x;
    *a = (w2xy - w2x * w2y / w2) / (w2x2 - d__1 * d__1 / w2);
    *b = (w2y - *a * w2x) / w2;
    if (icnt <= 2) {
	goto L3;
    }
 
    d__1 = w2y;
 
    d__2 = w2xy - w2x * w2y / w2;
 
    d__3 = w2x;
    *e = (w2y2 - d__1 * d__1 / w2 - d__2 * d__2 / (w2x2 - d__3 * d__3 / w2)) /
	     (icnt - 2);
    goto L4;

 
L1:
    *a = (float)0.;
    *b = (float)0.;
L3:
    *e = (float)0.;
L4:
    return 0;
}  

  int flush_(i1)
integer *i1;
{
    return 0;
}  

 
  int forest6_()
{
     
    integer s_wsle(), do_lio(), e_wsle();

     
    static cilist io___1235 = { 0, 6, 0, 0, 0 };
    static cilist io___1236 = { 0, 6, 0, 0, 0 };
    static cilist io___1237 = { 0, 6, 0, 0, 0 };
    static cilist io___1238 = { 0, 6, 0, 0, 0 };
    static cilist io___1239 = { 0, 6, 0, 0, 0 };
    static cilist io___1240 = { 0, 6, 0, 0, 0 };
    static cilist io___1241 = { 0, 6, 0, 0, 0 };
    static cilist io___1242 = { 0, 6, 0, 0, 0 };
    static cilist io___1243 = { 0, 6, 0, 0, 0 };
    static cilist io___1244 = { 0, 6, 0, 0, 0 };
    static cilist io___1245 = { 0, 6, 0, 0, 0 };
    static cilist io___1246 = { 0, 6, 0, 0, 0 };
    static cilist io___1247 = { 0, 6, 0, 0, 0 };
    static cilist io___1248 = { 0, 6, 0, 0, 0 };
    static cilist io___1249 = { 0, 6, 0, 0, 0 };
    static cilist io___1250 = { 0, 6, 0, 0, 0 };
    static cilist io___1251 = { 0, 6, 0, 0, 0 };


    s_wsle(&io___1235);
    do_lio(&c__9, &c__1, "#####################################################", 53L);
    e_wsle();
    s_wsle(&io___1236);
    do_lio(&c__9, &c__1, "#                                                   #", 53L);
    e_wsle();
    s_wsle(&io___1237);
    do_lio(&c__9, &c__1, "#      RED ALERT-RED ALERT- RED ALERT-RED ALERT     #", 53L);
    e_wsle();
    s_wsle(&io___1238);
    do_lio(&c__9, &c__1, "#                                                   #", 53L);
    e_wsle();
    s_wsle(&io___1239);
    do_lio(&c__9, &c__1, "#   ACHTUNG-ATTENTION-ATTENZIONE-ATTENCION-ABUNAI   #", 53L);
    e_wsle();
    s_wsle(&io___1240);
    do_lio(&c__9, &c__1, "#                                                   #", 53L);
    e_wsle();
    s_wsle(&io___1241);
    do_lio(&c__9, &c__1, "#   YOU ARE NOW USING AN EXTREMELY DANGEROUS        #", 53L);
    e_wsle();
    s_wsle(&io___1242);
    do_lio(&c__9, &c__1, "#   DA-PACKAGE ILLEGALLY AND CARELESSLY             #", 53L);
    e_wsle();
    s_wsle(&io___1243);
    do_lio(&c__9, &c__1, "#   MODIFIED IN ITS PRIVATE PARTS BY THE PERVERTED  #", 53L);
    e_wsle();
    s_wsle(&io___1244);
    do_lio(&c__9, &c__1, "#   ETIENNE FOREST!!!!!!!!                          #", 53L);
    e_wsle();
    s_wsle(&io___1245);
    do_lio(&c__9, &c__1, "#                                                   #", 53L);
    e_wsle();
    s_wsle(&io___1246);
    do_lio(&c__9, &c__1, "#   ETIENNE FOREST PROBABLY INFESTED THIS PROGRAM   #", 53L);
    e_wsle();
    s_wsle(&io___1247);
    do_lio(&c__9, &c__1, "#   PROGRAM WITH BUGS.                              #", 53L);
    e_wsle();
    s_wsle(&io___1248);
    do_lio(&c__9, &c__1, "#                                                   #", 53L);
    e_wsle();
    s_wsle(&io___1249);
    do_lio(&c__9, &c__1, "#   PLEASE CONTACT MARTIN BERZ FOR A SAFE VERSION.  #", 53L);
    e_wsle();
    s_wsle(&io___1250);
    do_lio(&c__9, &c__1, "#                                                   #", 53L);
    e_wsle();
    s_wsle(&io___1251);
    do_lio(&c__9, &c__1, "#####################################################", 53L);
    e_wsle();
    return 0;
}  

 
  int dapri6_(ina, result, ien, i56)
integer *ina;
doublereal *result;
integer *ien, *i56;
{
     
    integer i__1, i__2;

     
    integer s_wsle(), do_lio(), e_wsle();
      int s_stop();

     
    static integer i__, j[20], ii, ioa, ihp, illa, ilma, inoa, ipoa, inva, 
	    iout;
    extern   int dancd_();

     
    static cilist io___1252 = { 0, 6, 0, 0, 0 };


 

 
 

 
 
 

 

 



 
    *result = (float)0.;
 
    if (*ina < 1 || *ina > da_ .nda) {
	s_wsle(&io___1252);
	do_lio(&c__9, &c__1, "ERROR IN DAPRI6, INA = ", 23L);
	do_lio(&c__3, &c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	e_wsle();
 
 
	s_stop("", 0L);
    }

    inoa = da_ .idano[*ina - 1];
    inva = da_ .idanv[*ina - 1];
    ipoa = da_ .idapo[*ina - 1];
    ilma = da_ .idalm[*ina - 1];
    illa = da_ .idall[*ina - 1];


    iout = 0;

    if (da_ .nomax == 1) {
	i__1 = illa;
	for (i__ = 1; i__ <= i__1; ++i__) {
 
	    if (*ien == 1) {
		if (i__ - 1 != 0) {
		    goto L90;
		}
		*result = da_ .cc[ipoa + i__ - 2];
		return 0;
	    }
	    if (*ien == 2) {
		if (i__ - 1 != *i56) {
		    goto L90;
		}
		*result = da_ .cc[ipoa + i__ - 2];
		return 0;
	    }
L90:
	    ;
	}
    } else {
	i__1 = inoa;
	for (ioa = 0; ioa <= i__1; ++ioa) {
	    i__2 = ipoa + illa - 1;
	    for (ii = ipoa; ii <= i__2; ++ii) {
		if (da_ .ieo[da_ .ia1[da_ .i1[ii - 1]] + da_ .ia2[da_ .i2[ii 
			- 1]] - 1] != ioa) {
		    goto L100;
		}

		++iout;
		dancd_(& da_ .i1[ii - 1], & da_ .i2[ii - 1], j);

 
 
 
 

		if (*i56 == 6) {
		    for (ihp = 1; ihp <= 5; ++ihp) {
			if (j[ihp - 1] != 0) {
			    goto L100;
			}
 
		    }
		    if (j[5] == *ien - 1) {
			*result = da_ .cc[ii - 1];
			return 0;
		    }
		} else if (*i56 == 5) {
		    for (ihp = 1; ihp <= 4; ++ihp) {
			if (j[ihp - 1] != 0) {
			    goto L100;
			}
 
		    }
		    if (j[4] == *ien - 1) {
			*result = da_ .cc[ii - 1];
			return 0;
		    }
		}

 

L100:
		;
	    }
	}
    }


    return 0;
}  

 
  int darea6_(ina, zfeld, i56)
integer *ina;
doublereal *zfeld;
integer *i56;
{
     
    integer i__1;

     
    integer s_wsle(), do_lio(), e_wsle();
      int s_stop();

     
    static integer i__, j[20], ic, io, ip, ii1, ii2, io1, iin, illa, ilma, 
	    inoa, ipoa, inva;
    extern   int dadcd_(), dapac_(), daclr_();
    static integer iwarin, iwarno, iwarnv;

     
    static cilist io___1264 = { 0, 6, 0, 0, 0 };
    static cilist io___1280 = { 0, 6, 0, 0, 0 };


 

 
 
 

 

 

 



     
    --zfeld;

     
    if (*ina < 1 || *ina > da_ .nda) {
	s_wsle(&io___1264);
	do_lio(&c__9, &c__1, "ERROR IN DAREA6, INA = ", 23L);
	do_lio(&c__3, &c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	e_wsle();
 
 
	s_stop("", 0L);
    }

    inoa = da_ .idano[*ina - 1];
    inva = da_ .idanv[*ina - 1];
    ipoa = da_ .idapo[*ina - 1];
    ilma = da_ .idalm[*ina - 1];
    illa = da_ .idall[*ina - 1];

    for (i__ = 1; i__ <= 20; ++i__) {
 
	j[i__ - 1] = 0;
    }

    daclr_(&c__1);

    ic = 0;

    iwarno = 0;
    iwarnv = 0;
    iwarin = 0;

    iin = 0;

    if (da_ .nomax == 1) {
	i__1 = illa;
	for (i__ = 1; i__ <= i__1; ++i__) {
 

	    if (i__ - 1 == 0) {
		da_ .cc[ipoa + i__ - 2] = zfeld[1];
	    } else if (i__ - 1 == *i56) {
		da_ .cc[ipoa + i__ - 2] = zfeld[2];
	    }
 
	}
	return 0;
    }

    i__1 = inva;
    for (ip = 1; ip <= i__1; ++ip) {
	j[ip - 1] = 0;
 
    }
    io = 0;
L10:
    ++iin;
 
 

 
 
 
 
 
 
 
 
 
    io1 = 0;
    i__1 = inva;
    for (i__ = 1; i__ <= i__1; ++i__) {
 
	io1 += j[i__ - 1];
    }

    if (io1 != io) {
	if (iwarnv == 0) {
	    s_wsle(&io___1280);
	    do_lio(&c__9, &c__1, "WARNING IN DAREA6, FILE ", 24L);
	    do_lio(&c__9, &c__1, "CONTAINS MORE VARIABLES THAN VECTOR", 35L);
	    e_wsle();
	}
	iwarnv = 1;
	goto L10;
    }
    if (io > inoa) {
 
 
	iwarno = 1;
	goto L10;
    }

    ++ic;
    dadcd_(j, &ii1, &ii2);
    ic = da_ .ia1[ii1] + da_ .ia2[ii2];
    da_ .cc[ic - 1] = zfeld[io + 1];
    ++j[*i56 - 1];
    ++io;
    if (io > inoa) {
	goto L20;
    }
    goto L10;

L20:

    dapac_(ina, &c__1);

    return 0;
}  

 
 
  int dalya_(ina)
integer *ina;
{
     
    integer i__1;

     
    integer s_wsle(), do_lio(), e_wsle();
      int s_stop();

     
    static integer j[20], ii, jj, jr, ifl[6], ioa, illa, ilma, inoa, inva, 
	    ipoa;
    extern   int dancd_();

     
    static cilist io___1283 = { 0, 6, 0, 0, 0 };


 

 

 

 

 


    if (*ina < 1 || *ina > da_ .nda) {
	s_wsle(&io___1283);
	do_lio(&c__9, &c__1, "ERROR IN DALYA, INA = ", 22L);
	do_lio(&c__3, &c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	e_wsle();
	s_stop("", 0L);
    }
    inoa = da_ .idano[*ina - 1];
    inva = da_ .idanv[*ina - 1];
    ipoa = da_ .idapo[*ina - 1];
    ilma = da_ .idalm[*ina - 1];
    illa = da_ .idall[*ina - 1];
    ioa = 1;
    for (jr = 1; jr <= 6; ++jr) {
	ifl[jr - 1] = 0;
 
    }
    i__1 = ipoa + illa - 1;
    for (ii = ipoa; ii <= i__1; ++ii) {
	if (da_ .ieo[da_ .ia1[da_ .i1[ii - 1]] + da_ .ia2[da_ .i2[ii - 1]] - 
		1] != ioa) {
	    goto L100;
	}
	dancd_(& da_ .i1[ii - 1], & da_ .i2[ii - 1], j);
	for (jj = 1; jj <= 6; ++jj) {
	    if (j[jj - 1] == 1) {
		lya6_ .xlya6[jj - 1] = da_ .cc[ii - 1];
		ifl[jj - 1] = 1;
	    }
 
	}
L100:
	;
    }
    for (jr = 1; jr <= 6; ++jr) {
	if (ifl[jr - 1] == 0) {
	    lya6_ .xlya6[jr - 1] = 0.;
	}
 
    }
    return 0;
}  


 
  int ety_(nm, n, low, igh, a, ort)
integer *nm, *n, *low, *igh;
doublereal *a, *ort;
{
     
    integer a_dim1, a_offset, i__1, i__2, i__3;
    doublereal d__1;

     
    double sqrt(), d_sign();

     
    static doublereal f, g, h__;
    static integer i__, j, m, la, ii, jj, mp, kp1;
    static doublereal scale;


 

 
 
 

 
 
 
 

 

 
 
 

 

 
 
 

 

 

 
 
 
 

 
 

 
 


     
    a_dim1 = *nm;
    a_offset = a_dim1 + 1;
    a -= a_offset;
    --ort;

     
    la = *igh - 1;
    kp1 = *low + 1;
    if (la < kp1) {
	goto L200;
    }

    i__1 = la;
    for (m = kp1; m <= i__1; ++m) {
	h__ = (float)0.;
	ort[m] = (float)0.;
	scale = (float)0.;
 

	i__2 = *igh;
	for (i__ = m; i__ <= i__2; ++i__) {
 
	    scale += (d__1 = a[i__ + (m - 1) * a_dim1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
	}

	if (scale == (float)0.) {
	    goto L180;
	}
	mp = m + *igh;
 
	i__2 = *igh;
	for (ii = m; ii <= i__2; ++ii) {
	    i__ = mp - ii;
	    ort[i__] = a[i__ + (m - 1) * a_dim1] / scale;
	    h__ += ort[i__] * ort[i__];
 
	}

	d__1 = sqrt(h__);
	g = -d_sign(&d__1, &ort[m]);
	h__ -= ort[m] * g;
	ort[m] -= g;
 
	i__2 = *n;
	for (j = m; j <= i__2; ++j) {
	    f = (float)0.;
 
	    i__3 = *igh;
	    for (ii = m; ii <= i__3; ++ii) {
		i__ = mp - ii;
		f += ort[i__] * a[i__ + j * a_dim1];
 
	    }

	    f /= h__;

	    i__3 = *igh;
	    for (i__ = m; i__ <= i__3; ++i__) {
 
		a[i__ + j * a_dim1] -= f * ort[i__];
	    }

 
	}
 
	i__2 = *igh;
	for (i__ = 1; i__ <= i__2; ++i__) {
	    f = (float)0.;
 
	    i__3 = *igh;
	    for (jj = m; jj <= i__3; ++jj) {
		j = mp - jj;
		f += ort[j] * a[i__ + j * a_dim1];
 
	    }

	    f /= h__;

	    i__3 = *igh;
	    for (j = m; j <= i__3; ++j) {
 
		a[i__ + j * a_dim1] -= f * ort[j];
	    }

 
	}

	ort[m] = scale * ort[m];
	a[m + (m - 1) * a_dim1] = scale * g;
L180:
	;
    }

L200:
    return 0;
 
}  

 

 
  int etyt_(nm, n, low, igh, a, ort, z__)
integer *nm, *n, *low, *igh;
doublereal *a, *ort, *z__;
{
     
    integer a_dim1, a_offset, z_dim1, z_offset, i__1, i__2, i__3;

     
    static doublereal g;
    static integer i__, j, kl, mm, mp, mp1;



 
 
 

 
 
 

 

 
 
 

 

 
 
 

 
 
 

 
 
 

 

 
 

 

 
 


 
     
    z_dim1 = *nm;
    z_offset = z_dim1 + 1;
    z__ -= z_offset;
    --ort;
    a_dim1 = *nm;
    a_offset = a_dim1 + 1;
    a -= a_offset;

     
    i__1 = *n;
    for (i__ = 1; i__ <= i__1; ++i__) {

	i__2 = *n;
	for (j = 1; j <= i__2; ++j) {
 
	    z__[i__ + j * z_dim1] = (float)0.;
	}

	z__[i__ + i__ * z_dim1] = (float)1.;
 
    }

    kl = *igh - *low - 1;
    if (kl < 1) {
	goto L200;
    }
 
    i__1 = kl;
    for (mm = 1; mm <= i__1; ++mm) {
	mp = *igh - mm;
	if (a[mp + (mp - 1) * a_dim1] == (float)0.) {
	    goto L140;
	}
	mp1 = mp + 1;

	i__2 = *igh;
	for (i__ = mp1; i__ <= i__2; ++i__) {
 
	    ort[i__] = a[i__ + (mp - 1) * a_dim1];
	}

	i__2 = *igh;
	for (j = mp; j <= i__2; ++j) {
	    g = (float)0.;

	    i__3 = *igh;
	    for (i__ = mp; i__ <= i__3; ++i__) {
 
		g += ort[i__] * z__[i__ + j * z_dim1];
	    }
 

 

	    g = g / ort[mp] / a[mp + (mp - 1) * a_dim1];

	    i__3 = *igh;
	    for (i__ = mp; i__ <= i__3; ++i__) {
 
		z__[i__ + j * z_dim1] += g * ort[i__];
	    }

 
	}

L140:
	;
    }

L200:
    return 0;
 
}  

 

 
  int ety2_(nm, n, low, igh, h__, wr, wi, z__, ierr)
integer *nm, *n, *low, *igh;
doublereal *h__, *wr, *wi, *z__;
integer *ierr;
{
     
    integer h_dim1, h_offset, z_dim1, z_offset, i__1, i__2, i__3;
    doublereal d__1, d__2, d__3;

     
    double sqrt(), d_sign();

     
    static integer i__, j, k, l, m;
    static doublereal p, q, r__, s, t, w, x, y;
    static integer na, ii, en, jj;
    static doublereal ra, sa;
    static integer ll, mm, nn;
    static doublereal vi, vr, zz;
    static integer mp2;
    static doublereal z3i, z3r;
    static integer its, enm2;
    static doublereal norm;
    extern   int etdiv_();
    static doublereal machep;
    static logical notlas;


 
 
 
 
 



 
 
 

 
 
 
 
 
 

 

 
 
 

 

 
 
 

 

 
 
 
 
 

 

 

 
 
 
 
 
 
 

 
 
 

 
 
 
 


 
 
 
 

 
 

 
 


 
 

 
     
    z_dim1 = *nm;
    z_offset = z_dim1 + 1;
    z__ -= z_offset;
    --wi;
    --wr;
    h_dim1 = *nm;
    h_offset = h_dim1 + 1;
    h__ -= h_offset;

     
    machep = 1e-17;
 

    *ierr = 0;
    norm = (float)0.;
    k = 1;
 
 
    i__1 = *n;
    for (i__ = 1; i__ <= i__1; ++i__) {

	i__2 = *n;
	for (j = k; j <= i__2; ++j) {
 
	    norm += (d__1 = h__[i__ + j * h_dim1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
	}

	k = i__;
	if (i__ >= *low && i__ <= *igh) {
	    goto L50;
	}
	wr[i__] = h__[i__ + i__ * h_dim1];
	wi[i__] = (float)0.;
L50:
	;
    }

    en = *igh;
    t = (float)0.;
 
L60:
    if (en < *low) {
	goto L340;
    }
    its = 0;
    na = en - 1;
    enm2 = na - 1;
 
 
L70:
    i__1 = en;
    for (ll = *low; ll <= i__1; ++ll) {
	l = en + *low - ll;
	if (l == *low) {
	    goto L100;
	}
	s = (d__1 = h__[l - 1 + (l - 1) * h_dim1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) + (d__2 = h__[l 
		+ l * h_dim1], (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) );
	if (s == (float)0.) {
	    s = norm;
	}
	if ((d__1 = h__[l + (l - 1) * h_dim1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= machep * s) {
	    goto L100;
	}
 
    }
 
L100:
    x = h__[en + en * h_dim1];
    if (l == en) {
	goto L270;
    }
    y = h__[na + na * h_dim1];
    w = h__[en + na * h_dim1] * h__[na + en * h_dim1];
    if (l == na) {
	goto L280;
    }
    if (its == 30) {
	goto L1000;
    }
    if (its != 10 && its != 20) {
	goto L130;
    }
 
    t += x;

    i__1 = en;
    for (i__ = *low; i__ <= i__1; ++i__) {
 
	h__[i__ + i__ * h_dim1] -= x;
    }

    s = (d__1 = h__[en + na * h_dim1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) + (d__2 = h__[na + enm2 * 
	    h_dim1], (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) );
    x = s * (float).75;
    y = x;
    w = s * (float)-.4375 * s;
L130:
    ++its;
 
 
 
    i__1 = enm2;
    for (mm = l; mm <= i__1; ++mm) {
	m = enm2 + l - mm;
	zz = h__[m + m * h_dim1];
	r__ = x - zz;
	s = y - zz;
	p = (r__ * s - w) / h__[m + 1 + m * h_dim1] + h__[m + (m + 1) * 
		h_dim1];
	q = h__[m + 1 + (m + 1) * h_dim1] - zz - r__ - s;
	r__ = h__[m + 2 + (m + 1) * h_dim1];
	s = (( p ) >= 0 ? ( p ) : -( p ))  + (( q ) >= 0 ? ( q ) : -( q ))  + (( r__ ) >= 0 ? ( r__ ) : -( r__ )) ;
	p /= s;
	q /= s;
	r__ /= s;
	if (m == l) {
	    goto L150;
	}
	if ((d__1 = h__[m + (m - 1) * h_dim1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) * ((( q ) >= 0 ? ( q ) : -( q ))  + (( r__ ) >= 0 ? ( r__ ) : -( r__ )) 
		) <= machep * (( p ) >= 0 ? ( p ) : -( p ))  * ((d__2 = h__[m - 1 + (m - 1) * h_dim1],
		 (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) ) + (( zz ) >= 0 ? ( zz ) : -( zz ))  + (d__3 = h__[m + 1 + (m + 1) * h_dim1],
		 (( d__3 ) >= 0 ? ( d__3 ) : -( d__3 )) ))) {
	    goto L150;
	}
 
    }

L150:
    mp2 = m + 2;

    i__1 = en;
    for (i__ = mp2; i__ <= i__1; ++i__) {
	h__[i__ + (i__ - 2) * h_dim1] = (float)0.;
	if (i__ == mp2) {
	    goto L160;
	}
	h__[i__ + (i__ - 3) * h_dim1] = (float)0.;
L160:
	;
    }
 
 
    i__1 = na;
    for (k = m; k <= i__1; ++k) {
	notlas = k != na;
	if (k == m) {
	    goto L170;
	}
	p = h__[k + (k - 1) * h_dim1];
	q = h__[k + 1 + (k - 1) * h_dim1];
	r__ = (float)0.;
	if (notlas) {
	    r__ = h__[k + 2 + (k - 1) * h_dim1];
	}
	x = (( p ) >= 0 ? ( p ) : -( p ))  + (( q ) >= 0 ? ( q ) : -( q ))  + (( r__ ) >= 0 ? ( r__ ) : -( r__ )) ;
	if (x == (float)0.) {
	    goto L260;
	}
	p /= x;
	q /= x;
	r__ /= x;
L170:
	d__1 = sqrt(p * p + q * q + r__ * r__);
	s = d_sign(&d__1, &p);
	if (k == m) {
	    goto L180;
	}
	h__[k + (k - 1) * h_dim1] = -s * x;
	goto L190;
L180:
	if (l != m) {
	    h__[k + (k - 1) * h_dim1] = -h__[k + (k - 1) * h_dim1];
	}
L190:
	p += s;
	x = p / s;
	y = q / s;
	zz = r__ / s;
	q /= p;
	r__ /= p;
 
	i__2 = *n;
	for (j = k; j <= i__2; ++j) {
	    p = h__[k + j * h_dim1] + q * h__[k + 1 + j * h_dim1];
	    if (! notlas) {
		goto L200;
	    }
	    p += r__ * h__[k + 2 + j * h_dim1];
	    h__[k + 2 + j * h_dim1] -= p * zz;
L200:
	    h__[k + 1 + j * h_dim1] -= p * y;
	    h__[k + j * h_dim1] -= p * x;
 
	}

 
	i__2 = en, i__3 = k + 3;
	j = (( i__2 ) <= ( i__3 ) ? ( i__2 ) : ( i__3 )) ;
 
	i__2 = j;
	for (i__ = 1; i__ <= i__2; ++i__) {
	    p = x * h__[i__ + k * h_dim1] + y * h__[i__ + (k + 1) * h_dim1];
	    if (! notlas) {
		goto L220;
	    }
	    p += zz * h__[i__ + (k + 2) * h_dim1];
	    h__[i__ + (k + 2) * h_dim1] -= p * r__;
L220:
	    h__[i__ + (k + 1) * h_dim1] -= p * q;
	    h__[i__ + k * h_dim1] -= p;
 
	}
 
	i__2 = *igh;
	for (i__ = *low; i__ <= i__2; ++i__) {
	    p = x * z__[i__ + k * z_dim1] + y * z__[i__ + (k + 1) * z_dim1];
	    if (! notlas) {
		goto L240;
	    }
	    p += zz * z__[i__ + (k + 2) * z_dim1];
	    z__[i__ + (k + 2) * z_dim1] -= p * r__;
L240:
	    z__[i__ + (k + 1) * z_dim1] -= p * q;
	    z__[i__ + k * z_dim1] -= p;
 
	}

L260:
	;
    }

    goto L70;
 
L270:
    h__[en + en * h_dim1] = x + t;
    wr[en] = h__[en + en * h_dim1];
    wi[en] = (float)0.;
    en = na;
    goto L60;
 
L280:
    p = (y - x) / (float)2.;
    q = p * p + w;
    zz = sqrt(((( q ) >= 0 ? ( q ) : -( q )) ));
    h__[en + en * h_dim1] = x + t;
    x = h__[en + en * h_dim1];
    h__[na + na * h_dim1] = y + t;
    if (q < (float)0.) {
	goto L320;
    }
 
    zz = p + d_sign(&zz, &p);
    wr[na] = x + zz;
    wr[en] = wr[na];
    if (zz != (float)0.) {
	wr[en] = x - w / zz;
    }
    wi[na] = (float)0.;
    wi[en] = (float)0.;
    x = h__[en + na * h_dim1];
    s = (( x ) >= 0 ? ( x ) : -( x ))  + (( zz ) >= 0 ? ( zz ) : -( zz )) ;
    p = x / s;
    q = zz / s;
    r__ = sqrt(p * p + q * q);
    p /= r__;
    q /= r__;
 
    i__1 = *n;
    for (j = na; j <= i__1; ++j) {
	zz = h__[na + j * h_dim1];
	h__[na + j * h_dim1] = q * zz + p * h__[en + j * h_dim1];
	h__[en + j * h_dim1] = q * h__[en + j * h_dim1] - p * zz;
 
    }
 
    i__1 = en;
    for (i__ = 1; i__ <= i__1; ++i__) {
	zz = h__[i__ + na * h_dim1];
	h__[i__ + na * h_dim1] = q * zz + p * h__[i__ + en * h_dim1];
	h__[i__ + en * h_dim1] = q * h__[i__ + en * h_dim1] - p * zz;
 
    }
 
    i__1 = *igh;
    for (i__ = *low; i__ <= i__1; ++i__) {
	zz = z__[i__ + na * z_dim1];
	z__[i__ + na * z_dim1] = q * zz + p * z__[i__ + en * z_dim1];
	z__[i__ + en * z_dim1] = q * z__[i__ + en * z_dim1] - p * zz;
 
    }

    goto L330;
 
L320:
    wr[na] = x + p;
    wr[en] = x + p;
    wi[na] = zz;
    wi[en] = -zz;
L330:
    en = enm2;
    goto L60;
 
 
L340:
    if (norm == (float)0.) {
	goto L1001;
    }
 
    i__1 = *n;
    for (nn = 1; nn <= i__1; ++nn) {
	en = *n + 1 - nn;
	p = wr[en];
	q = wi[en];
	na = en - 1;
	if (q < 0.) {
	    goto L710;
	} else if (q == 0) {
	    goto L600;
	} else {
	    goto L800;
	}
 
L600:
	m = en;
	h__[en + en * h_dim1] = (float)1.;
	if (na == 0) {
	    goto L800;
	}
 
	i__2 = na;
	for (ii = 1; ii <= i__2; ++ii) {
	    i__ = en - ii;
	    w = h__[i__ + i__ * h_dim1] - p;
	    r__ = h__[i__ + en * h_dim1];
	    if (m > na) {
		goto L620;
	    }

	    i__3 = na;
	    for (j = m; j <= i__3; ++j) {
 
		r__ += h__[i__ + j * h_dim1] * h__[j + en * h_dim1];
	    }

L620:
	    if (wi[i__] >= (float)0.) {
		goto L630;
	    }
	    zz = w;
	    s = r__;
	    goto L700;
L630:
	    m = i__;
	    if (wi[i__] != (float)0.) {
		goto L640;
	    }
	    t = w;
	    if (w == (float)0.) {
		t = machep * norm;
	    }
	    h__[i__ + en * h_dim1] = -r__ / t;
	    goto L700;
 
L640:
	    x = h__[i__ + (i__ + 1) * h_dim1];
	    y = h__[i__ + 1 + i__ * h_dim1];
	    q = (wr[i__] - p) * (wr[i__] - p) + wi[i__] * wi[i__];
	    t = (x * s - zz * r__) / q;
	    h__[i__ + en * h_dim1] = t;
	    if ((( x ) >= 0 ? ( x ) : -( x ))  <= (( zz ) >= 0 ? ( zz ) : -( zz )) ) {
		goto L650;
	    }
	    h__[i__ + 1 + en * h_dim1] = (-r__ - w * t) / x;
	    goto L700;
L650:
	    h__[i__ + 1 + en * h_dim1] = (-s - y * t) / zz;
L700:
	    ;
	}
 
	goto L800;
 
L710:
	m = na;
 
 
	if ((d__1 = h__[en + na * h_dim1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= (d__2 = h__[na + en *
		 h_dim1], (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) )) {
	    goto L720;
	}
	h__[na + na * h_dim1] = q / h__[en + na * h_dim1];
	h__[na + en * h_dim1] = -(h__[en + en * h_dim1] - p) / h__[en + na * 
		h_dim1];
	goto L730;
 
 
 
L720:
	d__1 = -h__[na + en * h_dim1];
	d__2 = h__[na + na * h_dim1] - p;
	etdiv_(&z3r, &z3i, &c_b251, &d__1, &d__2, &q);
	h__[na + na * h_dim1] = z3r;
	h__[na + en * h_dim1] = z3i;
L730:
	h__[en + na * h_dim1] = (float)0.;
	h__[en + en * h_dim1] = (float)1.;
	enm2 = na - 1;
	if (enm2 == 0) {
	    goto L800;
	}
 
	i__2 = enm2;
	for (ii = 1; ii <= i__2; ++ii) {
	    i__ = na - ii;
	    w = h__[i__ + i__ * h_dim1] - p;
	    ra = (float)0.;
	    sa = h__[i__ + en * h_dim1];

	    i__3 = na;
	    for (j = m; j <= i__3; ++j) {
		ra += h__[i__ + j * h_dim1] * h__[j + na * h_dim1];
		sa += h__[i__ + j * h_dim1] * h__[j + en * h_dim1];
 
	    }

	    if (wi[i__] >= (float)0.) {
		goto L770;
	    }
	    zz = w;
	    r__ = ra;
	    s = sa;
	    goto L790;
L770:
	    m = i__;
	    if (wi[i__] != (float)0.) {
		goto L780;
	    }
 
 
 
	    d__1 = -ra;
	    d__2 = -sa;
	    etdiv_(&z3r, &z3i, &d__1, &d__2, &w, &q);
	    h__[i__ + na * h_dim1] = z3r;
	    h__[i__ + en * h_dim1] = z3i;
	    goto L790;
 
L780:
	    x = h__[i__ + (i__ + 1) * h_dim1];
	    y = h__[i__ + 1 + i__ * h_dim1];
	    vr = (wr[i__] - p) * (wr[i__] - p) + wi[i__] * wi[i__] - q * q;
	    vi = (wr[i__] - p) * (float)2. * q;
	    if (vr == (float)0. && vi == (float)0.) {
		vr = machep * norm * ((( w ) >= 0 ? ( w ) : -( w ))  + (( q ) >= 0 ? ( q ) : -( q ))  + (( x ) >= 0 ? ( x ) : -( x ))  + (( y ) >= 0 ? ( y ) : -( y ))  + (( 
			zz ) >= 0 ? (  			zz ) : -(  			zz )) );
	    }
 

 
 
	    d__1 = x * r__ - zz * ra + q * sa;
	    d__2 = x * s - zz * sa - q * ra;
	    etdiv_(&z3r, &z3i, &d__1, &d__2, &vr, &vi);
	    h__[i__ + na * h_dim1] = z3r;
	    h__[i__ + en * h_dim1] = z3i;
	    if ((( x ) >= 0 ? ( x ) : -( x ))  <= (( zz ) >= 0 ? ( zz ) : -( zz ))  + (( q ) >= 0 ? ( q ) : -( q )) ) {
		goto L785;
	    }
	    h__[i__ + 1 + na * h_dim1] = (-ra - w * h__[i__ + na * h_dim1] + 
		    q * h__[i__ + en * h_dim1]) / x;
	    h__[i__ + 1 + en * h_dim1] = (-sa - w * h__[i__ + en * h_dim1] - 
		    q * h__[i__ + na * h_dim1]) / x;
	    goto L790;
 

 
 
L785:
	    d__1 = -r__ - y * h__[i__ + na * h_dim1];
	    d__2 = -s - y * h__[i__ + en * h_dim1];
	    etdiv_(&z3r, &z3i, &d__1, &d__2, &zz, &q);
	    h__[i__ + 1 + na * h_dim1] = z3r;
	    h__[i__ + 1 + en * h_dim1] = z3i;
L790:
	    ;
	}
 
L800:
	;
    }
 
 
    i__1 = *n;
    for (i__ = 1; i__ <= i__1; ++i__) {
	if (i__ >= *low && i__ <= *igh) {
	    goto L840;
	}

	i__2 = *n;
	for (j = i__; j <= i__2; ++j) {
 
	    z__[i__ + j * z_dim1] = h__[i__ + j * h_dim1];
	}

L840:
	;
    }
 
 
 
    i__1 = *n;
    for (jj = *low; jj <= i__1; ++jj) {
	j = *n + *low - jj;
	m = (( j ) <= ( *igh ) ? ( j ) : ( *igh )) ;

	i__2 = *igh;
	for (i__ = *low; i__ <= i__2; ++i__) {
	    zz = (float)0.;

	    i__3 = m;
	    for (k = *low; k <= i__3; ++k) {
 
		zz += z__[i__ + k * z_dim1] * h__[k + j * h_dim1];
	    }

	    z__[i__ + j * z_dim1] = zz;
 
	}
    }

    goto L1001;
 
 
L1000:
    *ierr = en;
L1001:
    return 0;
 
}  


 

 
  int etdiv_(a, b, c__, d__, e, f)
doublereal *a, *b, *c__, *d__, *e, *f;
{
    static doublereal s, t, cc, dd, ee, ff;
    static integer flip;
    static doublereal temp;

 
 
 
 
 
 
 

    flip = 0;
    cc = *c__;
    dd = *d__;
    ee = *e;
    ff = *f;
    if ((( *f ) >= 0 ? ( *f ) : -( *f ))  >= (( *e ) >= 0 ? ( *e ) : -( *e )) ) {
	ee = *f;
	ff = *e;
	cc = *d__;
	dd = *c__;
	flip = 1;
    }
    s = 1. / ee;
    t = 1. / (ee + ff * (ff * s));
    if ((( ff ) >= 0 ? ( ff ) : -( ff ))  >= (( s ) >= 0 ? ( s ) : -( s )) ) {
	temp = ff;
	ff = s;
	s = temp;
    }
    if ((( dd ) >= 0 ? ( dd ) : -( dd ))  >= (( s ) >= 0 ? ( s ) : -( s )) ) {
	*a = t * (cc + s * (dd * ff));
    } else if ((( dd ) >= 0 ? ( dd ) : -( dd ))  >= (( ff ) >= 0 ? ( ff ) : -( ff )) ) {
	*a = t * (cc + dd * (s * ff));
    } else {
	*a = t * (cc + ff * (s * dd));
    }
    if ((( cc ) >= 0 ? ( cc ) : -( cc ))  >= (( s ) >= 0 ? ( s ) : -( s )) ) {
	*b = t * (dd - s * (cc * ff));
    } else if ((( cc ) >= 0 ? ( cc ) : -( cc ))  >= (( ff ) >= 0 ? ( ff ) : -( ff )) ) {
	*b = t * (dd - cc * (s * ff));
    } else {
	*b = t * (dd - ff * (s * cc));
    }
    if (flip != 0) {
	*b = -(*b);
    }
    return 0;
}  

 

 

 

 

 
  int sympl3_(m)
doublereal *m;
{
     
    integer i__1;

     
    static integer i__, jp, kp, kq, lp, lq, jq;
    static doublereal pp, pq, qq, qp;


 
 
 


     
    m -= 7;

     
    for (kp = 2; kp <= 6; kp += 2) {
	kq = kp - 1;
	i__1 = kp - 2;
	for (lp = 2; lp <= i__1; lp += 2) {
	    lq = lp - 1;
	    qq = 0.;
	    pq = 0.;
	    qp = 0.;
	    pp = 0.;
	    for (jp = 2; jp <= 6; jp += 2) {
		jq = jp - 1;
		qq = qq + m[lq + jq * 6] * m[kq + jp * 6] - m[lq + jp * 6] * 
			m[kq + jq * 6];
		pq = pq + m[lp + jq * 6] * m[kq + jp * 6] - m[lp + jp * 6] * 
			m[kq + jq * 6];
		qp = qp + m[lq + jq * 6] * m[kp + jp * 6] - m[lq + jp * 6] * 
			m[kp + jq * 6];
		pp = pp + m[lp + jq * 6] * m[kp + jp * 6] - m[lp + jp * 6] * 
			m[kp + jq * 6];
 
	    }
 
	    for (i__ = 1; i__ <= 6; ++i__) {
		m[kq + i__ * 6] = m[kq + i__ * 6] - qq * m[lp + i__ * 6] + pq 
			* m[lq + i__ * 6];
		m[kp + i__ * 6] = m[kp + i__ * 6] - qp * m[lp + i__ * 6] + pp 
			* m[lq + i__ * 6];
 
	    }
 
	}
	qp = 0.;
	for (jp = 2; jp <= 6; jp += 2) {
	    jq = jp - 1;
	    qp = qp + m[kq + jq * 6] * m[kp + jp * 6] - m[kq + jp * 6] * m[kp 
		    + jq * 6];
 
	}
 
	for (i__ = 1; i__ <= 6; ++i__) {
	    m[kp + i__ * 6] /= qp;
 
	}

 

 
 
 
 
 
 
 
 
 
 
 
    }
    return 0;
}  

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 



 
 
 
 


 
 

 

 
 
 
 

 
 
 
 
 
 
 
 
 
 


 
 

 

 

 

 
 
 

 
 
 

 
 

 
 
 
 
 
 

 
 
 
 
 
 
 
 
 

 
 
 

 

 

 

 

 

 

 

 
 


 
 
 
 
 

 
 

 

 

 
 
 
 
 
 


 
 

 
 

 
 
 

 
 

 

 
 
 
 
 
 

 
 

 

 
 
 

 

 

 
 
 
 


 
 
 
 
 

 
 
 
 
 
 
 
 
 

 

 

 

 

 

 
 


 

 
 

 
 
 
 
 


 
 
 
  int dakey_(c__, c_len)
char *c__;
ftnlen c_len;
{
     
    integer s_cmp(), s_wsle(), do_lio(), e_wsle();
      int s_stop();

     
    static cilist io___1366 = { 0, 6, 0, 0, 0 };


 


    if (s_cmp(c__, "FOX V2.1", c_len, 8L) != 0) {
	s_wsle(&io___1366);
	do_lio(&c__9, &c__1, "ERROR, WRONG VERSION OF DA PACKAGE", 34L);
	e_wsle();
	s_stop("", 0L);
    }
    return 0;

}  


 
  int fact_(n, dfact)
integer *n;
doublereal *dfact;
{
     
    integer i__1;

     
    static integer jf;
    static doublereal tfact, tfactt;

 

 

 

 


    tfact = 1.;
    i__1 = *n;
    for (jf = 1; jf <= i__1; ++jf) {
	tfactt = (doublereal) jf;
	tfact *= tfactt;
 
    }
    *dfact = tfact;

    return 0;
}  


 
  int daini_(no, nv, iunit)
integer *no, *nv, *iunit;
{
     
    integer i__1, i__2;
    doublereal d__1, d__2;

     
    integer s_wsle(), do_lio(), e_wsle();
      int s_stop();
    double pow_di();
      int s_copy();
    integer s_wsfi(), do_fio(), e_wsfi();

     
    static integer i__, j[20], k[21], n[21];
    static char aa[10];
    static doublereal cf;
    static integer jd, jj[20], jl, nn, js, ic1, ic2, io1, io2, jjj;
    static doublereal fac2, fac1, fac3;
    extern   int fact_();
    static integer iall, jord;
    extern   int dancd_(), daall_();
    static integer ibase, icmax;
    extern   int danum_();
    static integer newlea;

     
    static cilist io___1371 = { 0, 6, 0, 0, 0 };
    static cilist io___1372 = { 0, 6, 0, 0, 0 };
    static cilist io___1373 = { 0, 6, 0, 0, 0 };
    static cilist io___1374 = { 0, 6, 0, 0, 0 };
    static cilist io___1377 = { 0, 6, 0, 0, 0 };
    static cilist io___1378 = { 0, 6, 0, 0, 0 };
    static cilist io___1390 = { 0, 6, 0, 0, 0 };
    static cilist io___1397 = { 0, 6, 0, 0, 0 };
    static icilist io___1400 = { 0, aa+5, 0, "(I5)", 5, 1 };
    static cilist io___1402 = { 0, 6, 0, 0, 0 };
    static cilist io___1403 = { 0, 6, 0, 0, 0 };


 

 

 

 

 

 

 

 



    if (*nv == 0) {
	return 0;
    }
 
 
    da_ .eps = 1e-38;
    da_ .epsmac = 1e-7;
 

 
 

    da_ .nda = 0;
    da_ .nst = 0;
    da_ .nomax = *no;
    da_ .nvmax = *nv;
    danum_(no, nv, & da_ .nmmax);
    da_ .nocut = *no;
    da_ .lfi = 0;

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
    for (i__ = 0; i__ <= 500; ++i__) {
	da_ .ia1[i__] = 0;
	da_ .ia2[i__] = 0;
 
    }

    for (i__ = 1; i__ <= 100; ++i__) {
 
	dascr_ .iscrda[i__ - 1] = 0;
    }

    if (*nv > 20) {
	s_wsle(&io___1371);
	do_lio(&c__9, &c__1, "THE NUMBER OF VARIABLES IS TOO BIG", 34L);
	e_wsle();
	s_wsle(&io___1372);
	do_lio(&c__9, &c__1, "TO FIX IT INCREASE THE VALUE OF LNV SO THAT LNV > ", 50L);
	do_lio(&c__3, &c__1, (char *)&(*nv), (ftnlen)sizeof(integer));
	e_wsle();
	s_stop("", 0L);
    } else if (*no > 100) {
	s_wsle(&io___1373);
	do_lio(&c__9, &c__1, "THE ORDER SPECIFIED IS TOO BIG!", 31L);
	e_wsle();
	s_wsle(&io___1374);
	do_lio(&c__9, &c__1, "TO FIX IT INCREASE THE VALUE OF LNO SO THAT LNO > ", 50L);
	do_lio(&c__3, &c__1, (char *)&(*no), (ftnlen)sizeof(integer));
	e_wsle();
	s_stop("", 0L);
    }

    ibase = *no + 1;
    js = *nv / 2;
    d__1 = (doublereal) ibase;
    i__1 = (*nv + 1) / 2;
    if (pow_di(&d__1, &i__1) > 500.) {
	s_wsle(&io___1377);
	do_lio(&c__9, &c__1, "THE PARAMETER LIA IS NOT BIG ENOUGH", 35L);
	e_wsle();
	s_wsle(&io___1378);
	do_lio(&c__9, &c__1, "TO FIX IT REPLACE THE OLD VALUE WITH LIA > ", 
		43L);
	d__2 = (doublereal) ibase;
	i__1 = (*nv + 1) / 2;
	d__1 = pow_di(&d__2, &i__1);
	do_lio(&c__5, &c__1, (char *)&d__1, (ftnlen)sizeof(doublereal));
	e_wsle();
	s_stop("", 0L);
    }

    icmax = 0;
    nn = 0;
    k[0] = 0;

    i__1 = *no;
    for (io2 = 0; io2 <= i__1; ++io2) {
 

	n[0] = io2;
	jl = 0;
	jd = 1;

L50:
	jl += jd;

	if (jl == 0) {
	    goto L100;
	} else if (jd == 1) {
	    j[jl - 1] = 0;
	} else {
	    ++j[jl - 1];
	}

	k[jl] = k[jl - 1] * ibase + j[jl - 1];
	n[jl] = n[jl - 1] - j[jl - 1];

	if (j[jl - 1] > n[jl - 1]) {
	    jd = -1;
	    goto L50;
	} else if (jl < js) {
	    jd = 1;
	    goto L50;
	} else {
	    j[jl - 1] = n[jl - 1];
	    k[jl] = k[jl - 1] * ibase + j[jl - 1];
	    ic2 = k[jl];
	    icmax = (( icmax ) >= ( ic2 ) ? ( icmax ) : ( ic2 )) ;
	    k[jl] = 0;

	    da_ .ia2[ic2] = nn;

	    i__2 = *no - io2;
	    for (io1 = 0; io1 <= i__2; ++io1) {
 

		n[js] = io1;
		jd = 1;

L70:
		jl += jd;

		if (jl == js) {
		    goto L80;
		} else if (jd == 1) {
		    j[jl - 1] = 0;
		} else {
		    ++j[jl - 1];
		}

		k[jl] = k[jl - 1] * ibase + j[jl - 1];
		n[jl] = n[jl - 1] - j[jl - 1];

		if (j[jl - 1] > n[jl - 1]) {
		    jd = -1;
		    goto L70;
		} else if (jl < *nv) {
		    jd = 1;
		    goto L70;
		} else {
		    jd = -1;
		    j[jl - 1] = n[jl - 1];
		    k[jl] = k[jl - 1] * ibase + j[jl - 1];
		    ic1 = k[jl];
		    icmax = (( icmax ) >= ( ic1 ) ? ( icmax ) : ( ic1 )) ;
		    ++nn;

		    da_ .ie1[nn - 1] = ic1;
		    da_ .ie2[nn - 1] = ic2;
		    da_ .i1[nn - 1] = ic1;
		    da_ .i2[nn - 1] = ic2;
		    if (ic2 == 0) {
			da_ .ia1[ic1] = nn;
		    }
		    da_ .ieo[nn - 1] = io1 + io2;

		    goto L70;
		}

L80:
		;
	    }

	    jd = -1;
	    goto L50;
	}

L100:
	;
    }
 

    if (nn > 500) {
	s_wsle(&io___1390);
	do_lio(&c__9, &c__1, "THE PARAMETER LEA IS NOT BIG ENOUGH", 35L);
	e_wsle();
	cf = 0.;
	i__1 = *nv - 1;
	fact_(&i__1, &fac2);
	i__1 = *no;
	for (jord = 1; jord <= i__1; ++jord) {
	    i__2 = *nv + jord - 1;
	    fact_(&i__2, &fac1);
	    fact_(&jord, &fac3);
	    cf += fac1 / fac2 / fac3;
 
	}
	newlea = (integer) (cf + 1);
	s_wsle(&io___1397);
	do_lio(&c__9, &c__1, "TO FIX IT REPLACE THE OLD VALUE WITH LEA > ", 
		43L);
	do_lio(&c__3, &c__1, (char *)&newlea, (ftnlen)sizeof(integer));
	e_wsle();
	s_stop("", 0L);
    }

 
 

    iall = 0;
    daall_(&iall, &c__1, "$$UNPACK$$", & da_ .nomax, & da_ .nvmax, 10L);

    i__1 = da_ .nomax;
    for (i__ = 0; i__ <= i__1; ++i__) {
	s_copy(aa, "$$MUL   $$", 10L, 10L);
	s_wsfi(&io___1400);
	do_fio(&c__1, (char *)&i__, (ftnlen)sizeof(integer));
	e_wsfi();
	iall = 0;
	daall_(&iall, &c__1, aa, &i__, & da_ .nvmax, 10L);
 
    }

    da_ .idall[0] = da_ .nmmax;

 
 

    i__1 = da_ .nmmax;
    for (i__ = 1; i__ <= i__1; ++i__) {

	jjj = da_ .ia1[da_ .ie1[i__ - 1]] + da_ .ia2[da_ .ie2[i__ - 1]];
	if (jjj != i__) {
	    s_wsle(&io___1402);
	    do_lio(&c__9, &c__1, "ERROR IN DAINI IN ARRAYS IE1,IE2,IA1,IA2 AT I = ", 48L);
	    do_lio(&c__3, &c__1, (char *)&i__, (ftnlen)sizeof(integer));
	    e_wsle();
 
	}

 
    }

    if (*iunit == 0) {
	return 0;
    }

    s_wsle(&io___1403);
    do_lio(&c__9, &c__1, "ARRAY SETUP DONE, BEGIN PRINTING", 32L);
    e_wsle();

 

 
 
    i__1 = da_ .nmmax;
    for (i__ = 1; i__ <= i__1; ++i__) {
	dancd_(& da_ .ie1[i__ - 1], & da_ .ie2[i__ - 1], jj);
 

 
 
    }

 
 
 
 

    return 0;
}  


 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 

 
  int daall_(ic, l, ccc, no, nv, ccc_len)
integer *ic, *l;
char *ccc;
integer *no, *nv;
ftnlen ccc_len;
{
     
    integer i__1;

     
    integer s_wsle(), do_lio(), e_wsle();
      int s_stop(), s_copy();
    integer s_wsfi(), do_fio(), e_wsfi();

     
    static char c__[10];
    static integer i__;
    extern   int daclr_(), danum_();
    static integer ndanum;

     
    static cilist io___1406 = { 0, 6, 0, 0, 0 };
    static cilist io___1408 = { 0, 6, 0, 0, 0 };
    static cilist io___1409 = { 0, 6, 0, 0, 0 };
    static icilist io___1411 = { 0, c__+5, 0, "(I5)", 5, 1 };
    static cilist io___1412 = { 0, 6, 0, 0, 0 };
    static cilist io___1413 = { 0, 6, 0, 0, 0 };


 

 
 

 

 

 



     
    --ic;

     
    i__1 = *l;
    for (i__ = 1; i__ <= i__1; ++i__) {

	if (ic[i__] > 0 && ic[i__] <= da_ .nda) {
 
 
	} else {
	    if (*nv != 0 && (*no > da_ .nomax || *nv > da_ .nvmax)) {
		s_wsle(&io___1406);
		do_lio(&c__9, &c__1, "ERROR IN DAALL, VECTOR ", 23L);
		do_lio(&c__9, &c__1, c__, 10L);
		do_lio(&c__9, &c__1, " HAS NO, NV = ", 14L);
		do_lio(&c__3, &c__1, (char *)&(*no), (ftnlen)sizeof(integer));
		do_lio(&c__3, &c__1, (char *)&(*nv), (ftnlen)sizeof(integer));
		do_lio(&c__9, &c__1, " NOMAX, NVMAX = ", 16L);
		do_lio(&c__3, &c__1, (char *)& da_ .nomax, (ftnlen)sizeof(
			integer));
		do_lio(&c__3, &c__1, (char *)& da_ .nvmax, (ftnlen)sizeof(
			integer));
		e_wsle();
 
	    }

	    ++ da_ .nda;

	    if (da_ .nda > 10000) {
		s_wsle(&io___1408);
		do_lio(&c__9, &c__1, "THE PARAMETER LDA IS NOT BIG ENOUGH", 
			35L);
		e_wsle();
		s_wsle(&io___1409);
		do_lio(&c__9, &c__1, "TO FIX IT REPLACE THE OLD VALUE WITH LDA > ", 43L);
		do_lio(&c__3, &c__1, (char *)& da_ .nda, (ftnlen)sizeof(
			integer));
		e_wsle();
		s_stop("", 0L);
	    }

	    ic[i__] = da_ .nda;

	    if (*nv != 0) {
		danum_(no, nv, &ndanum);
	    } else {
		ndanum = *no;
	    }

	    s_copy(c__, ccc, 10L, 10L);
	    if (*l != 1) {
		s_wsfi(&io___1411);
		do_fio(&c__1, (char *)&i__, (ftnlen)sizeof(integer));
		e_wsfi();
	    }
	    s_copy(daname_ .daname + (da_ .nda - 1) * 10, c__, 10L, 10L);
	    da_ .idano[da_ .nda - 1] = *no;
	    da_ .idanv[da_ .nda - 1] = *nv;
	    da_ .idapo[da_ .nda - 1] = da_ .nst + 1;
	    da_ .idalm[da_ .nda - 1] = ndanum;
	    da_ .idall[da_ .nda - 1] = 0;

	    da_ .nst += ndanum;

	    if (da_ .nst > 100000) {
		s_wsle(&io___1412);
		do_lio(&c__9, &c__1, "THE PARAMETER LST IS NOT BIG ENOUGH", 
			35L);
		e_wsle();
		s_wsle(&io___1413);
		do_lio(&c__9, &c__1, "TO FIX IT REPLACE THE OLD VALUE WITH LST > ", 43L);
		do_lio(&c__3, &c__1, (char *)& da_ .nst, (ftnlen)sizeof(
			integer));
		e_wsle();
		s_stop("", 0L);
	    }

	    if (*nv == 0 || da_ .nomax == 1) {
		daclr_(&ic[i__]);
		da_ .idall[ic[i__] - 1] = da_ .idalm[ic[i__] - 1];
	    }
	}

 
    }

    return 0;
}  


 
  int dadal_(idal, l)
integer *idal, *l;
{
     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer i__;

     
    static cilist io___1415 = { 0, 6, 0, 0, 0 };


 

 

 

 



     
    --idal;

     
    for (i__ = *l; i__ >= 1; --i__) {

	if (idal[i__] <= da_ .nomax + 2 || idal[i__] > da_ .nda) {
	    s_wsle(&io___1415);
	    do_lio(&c__9, &c__1, "ERROR IN ROUTINE DADAL, IDAL(I),NDA = ", 
		    38L);
	    do_lio(&c__3, &c__1, (char *)&idal[i__], (ftnlen)sizeof(integer));
	    do_lio(&c__3, &c__1, (char *)& da_ .nda, (ftnlen)sizeof(integer));
	    e_wsle();
 
	}

	if (idal[i__] == da_ .nda) {
	    -- da_ .nda;
	    da_ .nst = da_ .idapo[da_ .nda] - 1;
	}

	da_ .idano[idal[i__] - 1] = 0;
	da_ .idanv[idal[i__] - 1] = 0;
	da_ .idapo[idal[i__] - 1] = 0;
	da_ .idalm[idal[i__] - 1] = 0;
	da_ .idall[idal[i__] - 1] = 0;

	idal[i__] = 0;

 
    }

    return 0;
}  

 
 
  int davar_(ina, ckon, i__)
integer *ina;
doublereal *ckon;
integer *i__;
{
     
    integer i__1;

     
    integer s_wsle(), do_lio(), e_wsle(), pow_ii();

     
    static integer ic1, ic2, illa, ilma, inoa, ipoa, inva;
    extern   int dainf_();
    static integer ibase;
    extern   int daclr_();

     
    static cilist io___1421 = { 0, 6, 0, 0, 0 };
    static cilist io___1422 = { 0, 6, 0, 0, 0 };
    static cilist io___1423 = { 0, 6, 0, 0, 0 };


 

 
 

 

 


    dainf_(ina, &inoa, &inva, &ipoa, &ilma, &illa);

    if (inva == 0) {
	s_wsle(&io___1421);
	do_lio(&c__9, &c__1, "ERROR IN DAVAR, ", 16L);
	do_lio(&c__3, &c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	do_lio(&c__9, &c__1, " IS A DECLARED CA VARIABLE", 26L);
	e_wsle();
 
    }

    if (*i__ > da_ .nvmax) {
	s_wsle(&io___1422);
	do_lio(&c__9, &c__1, "ERROR IN DAVAR, I = ", 20L);
	do_lio(&c__3, &c__1, (char *)&(*i__), (ftnlen)sizeof(integer));
	do_lio(&c__9, &c__1, " EXCEEDS NVMAX = ", 17L);
	do_lio(&c__3, &c__1, (char *)& da_ .nvmax, (ftnlen)sizeof(integer));
	e_wsle();
 
    }

    if (da_ .nomax == 1) {
	if (*i__ > inva) {
	    s_wsle(&io___1423);
	    do_lio(&c__9, &c__1, "ERROR IN DAVAR, I = ", 20L);
	    do_lio(&c__3, &c__1, (char *)&(*i__), (ftnlen)sizeof(integer));
	    do_lio(&c__9, &c__1, " EXCEEDS INVA = ", 16L);
	    do_lio(&c__3, &c__1, (char *)&inva, (ftnlen)sizeof(integer));
	    e_wsle();
 
	}
	daclr_(ina);
	da_ .cc[ipoa - 1] = *ckon;
	da_ .cc[ipoa + *i__ - 1] = 1.;
	return 0;
    }
    ibase = da_ .nomax + 1;

    if (*i__ > (da_ .nvmax + 1) / 2) {
	ic1 = 0;
	i__1 = *i__ - (da_ .nvmax + 1) / 2 - 1;
	ic2 = pow_ii(&ibase, &i__1);
    } else {
	i__1 = *i__ - 1;
	ic1 = pow_ii(&ibase, &i__1);
	ic2 = 0;
    }

    if ((( *ckon ) >= 0 ? ( *ckon ) : -( *ckon ))  > da_ .eps) {
	da_ .idall[*ina - 1] = 2;
	da_ .cc[ipoa - 1] = *ckon;
	da_ .i1[ipoa - 1] = 0;
	da_ .i2[ipoa - 1] = 0;

	da_ .cc[ipoa] = 1.;
	da_ .i1[ipoa] = ic1;
	da_ .i2[ipoa] = ic2;
    } else {
	da_ .idall[*ina - 1] = 1;
	da_ .cc[ipoa - 1] = 1.;
	da_ .i1[ipoa - 1] = ic1;
	da_ .i2[ipoa - 1] = ic2;
    }

    return 0;
}  

 
 
  int dacon_(ina, ckon)
integer *ina;
doublereal *ckon;
{
     
    integer i__1;

     
    static integer i__, illa, ilma, inoa, ipoa, inva;
    extern   int dainf_(), daclr_();

 

 

 

 


    dainf_(ina, &inoa, &inva, &ipoa, &ilma, &illa);

    if (inva == 0) {
	i__1 = ipoa + illa - 1;
	for (i__ = ipoa; i__ <= i__1; ++i__) {
 
	    da_ .cc[i__ - 1] = *ckon;
	}
	return 0;
    }

    if (da_ .nomax == 1) {
	daclr_(ina);
	da_ .cc[ipoa - 1] = *ckon;
	return 0;
    }
    da_ .idall[*ina - 1] = 1;
    da_ .cc[ipoa - 1] = *ckon;
    da_ .i1[ipoa - 1] = 0;
    da_ .i2[ipoa - 1] = 0;
    if ((( *ckon ) >= 0 ? ( *ckon ) : -( *ckon ))  < da_ .eps) {
	da_ .idall[*ina - 1] = 0;
    }

    return 0;
}  


 
  int danot_(not)
integer *not;
{
     
    integer s_wsle(), do_lio(), e_wsle();

     
    static cilist io___1433 = { 0, 6, 0, 0, 0 };


 

 

 

 


    if (*not > da_ .nomax) {
	s_wsle(&io___1433);
	do_lio(&c__9, &c__1, "ERROR, NOCUT = ", 15L);
	do_lio(&c__3, &c__1, (char *)& da_ .nocut, (ftnlen)sizeof(integer));
	do_lio(&c__9, &c__1, " EXCEEDS NOMAX = ", 17L);
	do_lio(&c__3, &c__1, (char *)& da_ .nomax, (ftnlen)sizeof(integer));
	e_wsle();
 
    }

    da_ .nocut = *not;

    return 0;
}  


 
  int daeps_(deps)
doublereal *deps;
{
 

 

 

 


    da_ .eps = *deps;

    return 0;
}  

 
 
  int dapek_(ina, jj, cjj)
integer *ina, *jj;
doublereal *cjj;
{
     
    integer i__1;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer i__, ic, iu, iz, ic1, ic2, ii1, jj1, icu, icz, illa, ilma, 
	    inoa, ipoa, ipek, inva;
    extern   int dadcd_(), dainf_();
    static integer ibase;

     
    static cilist io___1441 = { 0, 6, 0, 0, 0 };


 

 
 

 

 



     
    --jj;

     
    dainf_(ina, &inoa, &inva, &ipoa, &ilma, &illa);

    jj1 = 1;
    if (inva == 0 || da_ .nomax == 1) {
	if (inva != 0 && da_ .nomax == 1) {
	    if (illa >= 2) {
		i__1 = illa - 1;
		for (i__ = 1; i__ <= i__1; ++i__) {
		    if (jj[i__] == 1) {
			jj1 = i__ + 1;
		    }
 
		}
	    } else {
		jj1 = jj[1] + 1;
	    }
	} else {
	    jj1 = jj[1];
	}
	if (jj1 < 1 || jj1 > illa) {
	    s_wsle(&io___1441);
	    do_lio(&c__9, &c__1, "ERROR IN DAPEK, INDEX OUTSIDE RANGE, JJ(1) = ", 45L);
	    do_lio(&c__3, &c__1, (char *)&jj1, (ftnlen)sizeof(integer));
	    e_wsle();
 
	}
	ipek = ipoa + jj1 - 1;
	*cjj = da_ .cc[ipek - 1];
	return 0;
    }

    ii1 = (da_ .nvmax + 1) / 2;
    ibase = da_ .nomax + 1;

 
 

    dadcd_(&jj[1], &ic1, &ic2);

    ic = da_ .ia1[ic1] + da_ .ia2[ic2];

 
 

 
 
 
 

 
 

    iu = ipoa;
    iz = ipoa + illa - 1;
    icu = da_ .ia1[da_ .i1[iu - 1]] + da_ .ia2[da_ .i2[iu - 1]];
    icz = da_ .ia1[da_ .i1[iz - 1]] + da_ .ia2[da_ .i2[iz - 1]];

    if (illa == 0) {
	*cjj = 0.;
	return 0;
    } else if (ic == icu) {
	*cjj = da_ .cc[iu - 1];
	return 0;
    } else if (ic == icz) {
	*cjj = da_ .cc[iz - 1];
	return 0;
    } else if (ic < icu || ic > icz) {
	*cjj = 0.;
	return 0;
    }

 
 

L10:
    if (iz - iu <= 1) {
	*cjj = 0.;
	return 0;
    }
    i__ = (iu + iz) / 2;

    if ((i__1 = da_ .ia1[da_ .i1[i__ - 1]] + da_ .ia2[da_ .i2[i__ - 1]] - ic) 
	    < 0) {
	goto L20;
    } else if (i__1 == 0) {
	goto L30;
    } else {
	goto L40;
    }
L20:
    iu = i__;
    goto L10;
L30:
    *cjj = da_ .cc[i__ - 1];
    return 0;
L40:
    iz = i__;
    goto L10;

}  

 
 
  int dapok_(ina, jj, cjj)
integer *ina, *jj;
doublereal *cjj;
{
     
    integer i__1;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer i__, ic, ii, iu, iz, ic1, ic2, jj1, icu, icz, illa, ilma, 
	    inoa, ipoa, inva, ipok;
    extern   int dadcd_(), dainf_();

     
    static cilist io___1459 = { 0, 6, 0, 0, 0 };
    static cilist io___1469 = { 0, 6, 0, 0, 0 };


 

 
 

 

 



     
    --jj;

     
    dainf_(ina, &inoa, &inva, &ipoa, &ilma, &illa);

 
 

    jj1 = 1;
    if (inva == 0 || da_ .nomax == 1) {
	if (inva != 0 && da_ .nomax == 1) {
	    if (illa >= 2) {
		i__1 = illa - 1;
		for (i__ = 1; i__ <= i__1; ++i__) {
		    if (jj[i__] == 1) {
			jj1 = i__ + 1;
		    }
 
		}
	    } else {
		jj1 = jj[1] + 1;
	    }
	} else {
	    jj1 = jj[1];
	}
	if (jj1 < 1 || jj1 > illa) {
	    s_wsle(&io___1459);
	    do_lio(&c__9, &c__1, "ERROR IN DAPOK, INDEX OUTSIDE RANGE, JJ(1) = ", 45L);
	    do_lio(&c__3, &c__1, (char *)&jj1, (ftnlen)sizeof(integer));
	    e_wsle();
 
	}
	ipok = ipoa + jj1 - 1;
	da_ .cc[ipok - 1] = *cjj;
	return 0;
    }

 
 

    dadcd_(&jj[1], &ic1, &ic2);

    ic = da_ .ia1[ic1] + da_ .ia2[ic2];

 
 

 
 
 
 
 

    iu = ipoa;
    iz = ipoa + illa - 1;

 
 

    icu = da_ .ia1[da_ .i1[iu - 1]] + da_ .ia2[da_ .i2[iu - 1]];
    icz = da_ .ia1[da_ .i1[iz - 1]] + da_ .ia2[da_ .i2[iz - 1]];
    if (illa == 0) {
	i__ = ipoa;
	goto L100;
    } else if (ic == icu) {
	da_ .cc[iu - 1] = *cjj;
	i__ = iu;
	goto L200;
    } else if (ic == icz) {
	da_ .cc[iz - 1] = *cjj;
	i__ = iz;
	goto L200;
    } else if (ic < icu) {
	i__ = iu;
	goto L100;
    } else if (ic > icz) {
	i__ = iz + 1;
	goto L100;
    }


 
 

    iu = ipoa;
    iz = ipoa + illa;

L10:
    if (iz - iu <= 1) {
	i__ = iz;
	goto L100;
    }
    i__ = (iu + iz) / 2;

    if ((i__1 = da_ .ia1[da_ .i1[i__ - 1]] + da_ .ia2[da_ .i2[i__ - 1]] - ic) 
	    < 0) {
	goto L20;
    } else if (i__1 == 0) {
	goto L30;
    } else {
	goto L40;
    }
L20:
    iu = i__;
    goto L10;
L30:
    da_ .cc[i__ - 1] = *cjj;
    goto L200;
L40:
    iz = i__;
    goto L10;

 
 

L100:

    if ((( *cjj ) >= 0 ? ( *cjj ) : -( *cjj ))  < da_ .eps) {
	return 0;
    }

    i__1 = i__ + 1;
    for (ii = ipoa + illa; ii >= i__1; --ii) {
	da_ .cc[ii - 1] = da_ .cc[ii - 2];
	da_ .i1[ii - 1] = da_ .i1[ii - 2];
	da_ .i2[ii - 1] = da_ .i2[ii - 2];
 
    }

    da_ .cc[i__ - 1] = *cjj;
    da_ .i1[i__ - 1] = ic1;
    da_ .i2[i__ - 1] = ic2;

    da_ .idall[*ina - 1] = illa + 1;
    if (da_ .idall[*ina - 1] > da_ .idalm[*ina - 1]) {
	s_wsle(&io___1469);
	do_lio(&c__9, &c__1, "ERROR IN DAPOK, INA =  ", 23L);
	do_lio(&c__3, &c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	e_wsle();
 
    }

    return 0;

 
 

L200:
    if ((( *cjj ) >= 0 ? ( *cjj ) : -( *cjj ))  < da_ .eps) {
	i__1 = ipoa + illa - 2;
	for (ii = i__; ii <= i__1; ++ii) {
	    da_ .cc[ii - 1] = da_ .cc[ii];
	    da_ .i1[ii - 1] = da_ .i1[ii];
	    da_ .i2[ii - 1] = da_ .i2[ii];
 
	}
	da_ .idall[*ina - 1] = illa - 1;
    }
    return 0;

}  

 
 
  int daclr_(inc)
integer *inc;
{
     
    integer i__1;

     
    static integer i__, illc, ilmc, inoc, ipoc, invc;
    extern   int dainf_();

 

 
 

 

 


    dainf_(inc, &inoc, &invc, &ipoc, &ilmc, &illc);

    i__1 = ipoc + ilmc - 1;
    for (i__ = ipoc; i__ <= i__1; ++i__) {

	da_ .cc[i__ - 1] = 0.;

 
    }

    return 0;
}  

 
 
  int dacop_(ina, inb)
integer *ina, *inb;
{
     
    integer i__1;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer ia, ib, iif, illa, ilma, ilmb, illb, inoa, inob, ipoa, 
	    ipob, inva, invb;
    extern   int dachk_(), dainf_();

     
    static cilist io___1489 = { 0, 6, 0, 0, 0 };


 

 

 

 


    dainf_(ina, &inoa, &inva, &ipoa, &ilma, &illa);
    dainf_(inb, &inob, &invb, &ipob, &ilmb, &illb);

    dachk_(ina, &inoa, &inva, &c__0, &c_n1, &c_n1, inb, &inob, &invb);

    ib = ipob - 1;

    iif = 0;
    if (da_ .nomax == 1 || inva == 0) {
	iif = 1;
    }
    i__1 = ipoa + illa - 1;
    for (ia = ipoa; ia <= i__1; ++ia) {

	if (iif == 0) {
	    if (da_ .ieo[da_ .ia1[da_ .i1[ia - 1]] + da_ .ia2[da_ .i2[ia - 1]]
		     - 1] > da_ .nocut) {
		goto L100;
	    }
	}
	++ib;
	da_ .cc[ib - 1] = da_ .cc[ia - 1];
	da_ .i1[ib - 1] = da_ .i1[ia - 1];
	da_ .i2[ib - 1] = da_ .i2[ia - 1];

L100:
	;
    }

    da_ .idall[*inb - 1] = ib - ipob + 1;
    if (da_ .idall[*inb - 1] > da_ .idalm[*inb - 1]) {
	s_wsle(&io___1489);
	do_lio(&c__9, &c__1, "ERROR IN DACOP", 14L);
	e_wsle();
 
    }

    return 0;
}  

 
 
  int daadd_(ina, inb, inc)
integer *ina, *inb, *inc;
{
    static integer illc, ilmc, inoc, ipoc, invc;
    extern   int dadal_(), daall_(), dainf_(), dacop_(), 
	    dalin_();
    static integer idaadd;

 

 

 

    if (*ina != *inc && *inb != *inc) {
	dalin_(ina, &c_b2366, inb, &c_b2366, inc);
    } else {
	idaadd = 0;
	dainf_(inc, &inoc, &invc, &ipoc, &ilmc, &illc);
	daall_(&idaadd, &c__1, "$$DAADD $$", &inoc, &invc, 10L);
	dalin_(ina, &c_b2366, inb, &c_b2366, &idaadd);
	dacop_(&idaadd, inc);
	dadal_(&idaadd, &c__1);
    }

    return 0;
}  


 
  int dasub_(ina, inb, inc)
integer *ina, *inb, *inc;
{
    static integer illc, ilmc, inoc, ipoc, invc;
    extern   int dadal_(), daall_(), dainf_(), dacop_(), 
	    dalin_();
    static integer idasub;

 

 

 

    if (*ina != *inc && *inb != *inc) {
	dalin_(ina, &c_b2366, inb, &c_b2381, inc);
    } else {
	idasub = -1;
	dainf_(inc, &inoc, &invc, &ipoc, &ilmc, &illc);
	daall_(&idasub, &c__1, "$$DASUB $$", &inoc, &invc, 10L);
	dalin_(ina, &c_b2366, inb, &c_b2381, &idasub);
	dacop_(&idasub, inc);
	dadal_(&idasub, &c__1);
    }

    return 0;
}  

 
 
  int damul_(ina, inb, inc)
integer *ina, *inb, *inc;
{
    static integer incc, illc, ilmc, inoc, ipoc, invc;
    extern   int dadal_(), daall_(), dainf_(), dacop_(), 
	    damult_();

 

 

 
 

 

 



    if (*ina == *inc || *inb == *inc) {
	dainf_(inc, &inoc, &invc, &ipoc, &ilmc, &illc);
	incc = 0;
	daall_(&incc, &c__1, "$$DAJUNK$$", &inoc, &invc, 10L);
	damult_(ina, inb, &incc);
	dacop_(&incc, inc);
	dadal_(&incc, &c__1);
    } else {
	damult_(ina, inb, inc);
    }
    return 0;
}  


 
  int damult_(ina, inb, inc)
integer *ina, *inb, *inc;
{
     
    integer i__1, i__2, i__3;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer i__, ia, ib, ic, nom, i1ia, i2ia;
    static doublereal ccia;
    static integer illa, ilma, ilmb, illb, ilmc, inoa, inob, noff[101], ipoa, 
	    ipob, inva, invb, inoc, invc, ipoc, illc, noib, ipno[101], minv, 
	    ipos;
    extern   int dapac_(), dachk_(), dainf_(), daclr_();
    static integer ioffb;
    static doublereal ccipoa, ccipob;

     
    static cilist io___1524 = { 0, 6, 0, 0, 0 };


 

 

 
 

 

 



    dainf_(ina, &inoa, &inva, &ipoa, &ilma, &illa);
    dainf_(inb, &inob, &invb, &ipob, &ilmb, &illb);
    dainf_(inc, &inoc, &invc, &ipoc, &ilmc, &illc);

    dachk_(ina, &inoa, &inva, inb, &inob, &invb, inc, &inoc, &invc);

    if (inva + invb + invc == 0) {
	i__1 = (( illa ) <= ( illb ) ? ( illa ) : ( illb ))  - 1;
	for (i__ = 0; i__ <= i__1; ++i__) {
 
	    da_ .cc[ipoc + i__ - 1] = da_ .cc[ipoa + i__ - 1] * da_ .cc[ipob 
		    + i__ - 1];
	}
	da_ .idall[*inc - 1] = (( illa ) <= ( illb ) ? ( illa ) : ( illb )) ;
	if (da_ .idall[*inc - 1] > da_ .idalm[*inc - 1]) {
	    s_wsle(&io___1524);
	    do_lio(&c__9, &c__1, "ERROR IN DAMUL ", 15L);
	    e_wsle();
 
	}
	return 0;
    }

 
 
    if (da_ .nomax == 1) {
 
	i__1 = (( inva ) <= ( invb ) ? ( inva ) : ( invb )) ;
	minv = (( i__1 ) <= ( invc ) ? ( i__1 ) : ( invc )) ;
	ccipoa = da_ .cc[ipoa - 1];
	ccipob = da_ .cc[ipob - 1];
	da_ .cc[ipoc - 1] = ccipoa * ccipob;
	i__1 = minv;
	for (i__ = 1; i__ <= i__1; ++i__) {
 
	    da_ .cc[ipoc + i__ - 1] = ccipoa * da_ .cc[ipob + i__ - 1] + 
		    ccipob * da_ .cc[ipoa + i__ - 1];
	}
	i__1 = ipoc + invc;
	for (i__ = ipoc + minv + 1; i__ <= i__1; ++i__) {
 
	    da_ .cc[i__ - 1] = 0.;
	}
	return 0;
    }

 
 

    i__1 = da_ .nomax;
    for (i__ = 0; i__ <= i__1; ++i__) {
	noff[i__] = da_ .idapo[i__ + 1];
 
	ipno[i__] = 0;
    }

    daclr_(&c__1);

 
 

    i__1 = ipob + illb - 1;
    for (ib = ipob; ib <= i__1; ++ib) {

	noib = da_ .ieo[da_ .ia1[da_ .i1[ib - 1]] + da_ .ia2[da_ .i2[ib - 1]] 
		- 1];
	ipos = ipno[noib] + 1;
	ipno[noib] = ipos;
	inob = noff[noib] + ipos;

	da_ .cc[inob - 1] = da_ .cc[ib - 1];
	da_ .i1[inob - 1] = da_ .i1[ib - 1];
	da_ .i2[inob - 1] = da_ .i2[ib - 1];

 
    }

    i__1 = da_ .nomax;
    for (i__ = 0; i__ <= i__1; ++i__) {
 
	da_ .idall[i__ + 1] = ipno[i__];
    }

 
 

    nom = (( da_ .nocut ) <= ( inoc ) ? ( da_ .nocut ) : ( inoc )) ;

    i__1 = ipoa + illa - 1;
    for (ia = ipoa; ia <= i__1; ++ia) {

	i1ia = da_ .i1[ia - 1];
	i2ia = da_ .i2[ia - 1];
	ccia = da_ .cc[ia - 1];

	i__2 = nom - da_ .ieo[da_ .ia1[da_ .i1[ia - 1]] + da_ .ia2[da_ .i2[ia 
		- 1]] - 1];
	for (noib = 0; noib <= i__2; ++noib) {

	    ioffb = noff[noib];

	    i__3 = ioffb + ipno[noib];
	    for (ib = ioffb + 1; ib <= i__3; ++ib) {

		ic = da_ .ia2[i2ia + da_ .i2[ib - 1]] + da_ .ia1[i1ia + 
			da_ .i1[ib - 1]];
		da_ .cc[ic - 1] += ccia * da_ .cc[ib - 1];

 
	    }
	}
    }

    dapac_(inc, &c__1);

    return 0;
}  


 
  int dadiv_(ina, inb, inc)
integer *ina, *inb, *inc;
{
    static integer illc, ilmc, inoc, ipoc, invc;
    extern   int dadal_(), daall_(), dainf_(), dafun_(), 
	    damul_();
    static integer idadiv;

 

 

 

    idadiv = 0;
    dainf_(inc, &inoc, &invc, &ipoc, &ilmc, &illc);
    daall_(&idadiv, &c__1, "$$DADIV $$", &inoc, &invc, 10L);
    dafun_("INV   ", inb, &idadiv, 6L);
    damul_(ina, &idadiv, inc);
    dadal_(&idadiv, &c__1);

    return 0;
}  

 
 
  int dasqr_(ina, inc)
integer *ina, *inc;
{
    static integer incc, illc, ilmc, inoc, ipoc, invc;
    extern   int dadal_(), daall_(), dainf_(), dacop_(), 
	    dasqrt_();

 

 

 

 


    if (*ina == *inc) {
	dainf_(inc, &inoc, &invc, &ipoc, &ilmc, &illc);
	incc = 0;
	daall_(&incc, &c__1, "$$DAJUNK$$", &inoc, &invc, 10L);
	dasqrt_(ina, &incc);
	dacop_(&incc, inc);
	dadal_(&incc, &c__1);
    } else {
	dasqrt_(ina, inc);
    }
    return 0;
}  

 
  int dasqrt_(ina, inc)
integer *ina, *inc;
{
     
    integer i__1, i__2, i__3, i__4;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer i__, ia, ib, ic, ib1, nom, i1ia, i2ia;
    static doublereal ccia;
    static integer illa, ilma, illc, ilmc, inoa, noia, noff[101], ipoa, inoc, 
	    inva, invc, ipoc, noib, ipno[101], minv, ipos;
    extern   int dapac_(), dachk_(), dainf_();
    static integer ioffa;
    extern   int daclr_();
    static integer ioffb;
    static doublereal ccipoa;

     
    static cilist io___1563 = { 0, 6, 0, 0, 0 };


 

 

 

 



    dainf_(ina, &inoa, &inva, &ipoa, &ilma, &illa);
    dainf_(inc, &inoc, &invc, &ipoc, &ilmc, &illc);

    dachk_(ina, &inoa, &inva, &c__0, &c_n1, &c_n1, inc, &inoc, &invc);

    if (inva + invc == 0) {
	i__1 = illa - 1;
	for (i__ = 0; i__ <= i__1; ++i__) {
 
	    da_ .cc[ipoc + i__ - 1] = da_ .cc[ipoa + i__ - 1] * da_ .cc[ipoa 
		    + i__ - 1];
	}
	da_ .idall[*inc - 1] = da_ .idall[*ina - 1];
	if (da_ .idall[*inc - 1] > da_ .idalm[*inc - 1]) {
	    s_wsle(&io___1563);
	    do_lio(&c__9, &c__1, "ERROR IN DASQR ", 15L);
	    e_wsle();
 
	}
	return 0;
    }

 
 
    if (da_ .nomax == 1) {
	minv = (( inva ) <= ( invc ) ? ( inva ) : ( invc )) ;
	ccipoa = da_ .cc[ipoa - 1];
	da_ .cc[ipoc - 1] = ccipoa * ccipoa;
	i__1 = minv;
	for (i__ = 1; i__ <= i__1; ++i__) {
 
	    da_ .cc[ipoc + i__ - 1] = ccipoa * 2. * da_ .cc[ipoa + i__ - 1];
	}
	i__1 = ipoc + invc;
	for (i__ = ipoc + minv + 1; i__ <= i__1; ++i__) {
 
	    da_ .cc[i__ - 1] = 0.;
	}
	return 0;
    }

 
 

    i__1 = da_ .nomax;
    for (i__ = 0; i__ <= i__1; ++i__) {
	noff[i__] = da_ .idapo[i__ + 1];
 
	ipno[i__] = 0;
    }

    daclr_(&c__1);

 
 

    i__1 = ipoa + illa - 1;
    for (ia = ipoa; ia <= i__1; ++ia) {

	noia = da_ .ieo[da_ .ia1[da_ .i1[ia - 1]] + da_ .ia2[da_ .i2[ia - 1]] 
		- 1];
	ipos = ipno[noia] + 1;
	ipno[noia] = ipos;
	inoa = noff[noia] + ipos;

	da_ .cc[inoa - 1] = da_ .cc[ia - 1];
	da_ .i1[inoa - 1] = da_ .i1[ia - 1];
	da_ .i2[inoa - 1] = da_ .i2[ia - 1];

 
    }

    i__1 = da_ .nomax;
    for (i__ = 0; i__ <= i__1; ++i__) {
 
	da_ .idall[i__ + 1] = ipno[i__];
    }

 
 

    nom = (( da_ .nocut ) <= ( inoc ) ? ( da_ .nocut ) : ( inoc )) ;

    i__1 = nom / 2;
    for (noia = 0; noia <= i__1; ++noia) {

	ioffa = noff[noia];

	i__2 = ioffa + ipno[noia];
	for (ia = ioffa + 1; ia <= i__2; ++ia) {

	    i1ia = da_ .i1[ia - 1];
	    i2ia = da_ .i2[ia - 1];
	    ccia = da_ .cc[ia - 1];

	    ic = da_ .ia2[i2ia + i2ia] + da_ .ia1[i1ia + i1ia];
	    da_ .cc[ic - 1] += ccia * ccia;
	    ccia += ccia;

	    i__3 = nom - noia;
	    for (noib = noia; noib <= i__3; ++noib) {

		ioffb = noff[noib];
		if (noib == noia) {
		    ib1 = ia + 1;
		} else {
		    ib1 = ioffb + 1;
		}

		i__4 = ioffb + ipno[noib];
		for (ib = ib1; ib <= i__4; ++ib) {

		    ic = da_ .ia2[i2ia + da_ .i2[ib - 1]] + da_ .ia1[i1ia + 
			    da_ .i1[ib - 1]];
		    da_ .cc[ic - 1] += ccia * da_ .cc[ib - 1];

 
		}
	    }
	}
    }

    dapac_(inc, &c__1);

    return 0;
}  


 
  int dacad_(ina, ckon, inb)
integer *ina;
doublereal *ckon;
integer *inb;
{
     

    static integer jj[20] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };

     
    integer i__1;
    doublereal d__1;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer i__, illa, ilma, ilmb, illb, inoa, inob, ipoa, ipob, inva, 
	    invb;
    extern   int dainf_(), dapek_(), dacop_(), dapok_();
    static doublereal const__;

     
    static cilist io___1593 = { 0, 6, 0, 0, 0 };


 

 

 

 


    dainf_(ina, &inoa, &inva, &ipoa, &ilma, &illa);
    dainf_(inb, &inob, &invb, &ipob, &ilmb, &illb);

    if (inva == 0) {
	i__1 = illb - 1;
	for (i__ = 0; i__ <= i__1; ++i__) {
 
	    da_ .cc[i__ + ipob - 1] = da_ .cc[i__ + ipoa - 1] + *ckon;
	}
	da_ .idall[*inb - 1] = illa;
	if (da_ .idall[*inb - 1] > da_ .idalm[*inb - 1]) {
	    s_wsle(&io___1593);
	    do_lio(&c__9, &c__1, "ERROR IN DACAD", 14L);
	    e_wsle();
 
	}
	return 0;
    }

    dacop_(ina, inb);

    if (da_ .nomax == 1) {
	da_ .cc[ipob - 1] += *ckon;
	return 0;
    }

    dapek_(inb, jj, &const__);
    d__1 = const__ + *ckon;
    dapok_(inb, jj, &d__1);

    return 0;
}  


 
  int dacsu_(ina, ckon, inb)
integer *ina;
doublereal *ckon;
integer *inb;
{
     

    static integer jj[20] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };

     
    integer i__1;
    doublereal d__1;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer i__, illa, ilma, ilmb, illb, inoa, inob, ipoa, ipob, inva, 
	    invb;
    extern   int dainf_(), dapek_(), dacop_(), dapok_();
    static doublereal const__;

     
    static cilist io___1607 = { 0, 6, 0, 0, 0 };


 

 

 

 


    dainf_(ina, &inoa, &inva, &ipoa, &ilma, &illa);
    dainf_(inb, &inob, &invb, &ipob, &ilmb, &illb);

    if (inva == 0) {
	i__1 = illa - 1;
	for (i__ = 0; i__ <= i__1; ++i__) {
 
	    da_ .cc[i__ + ipob - 1] = da_ .cc[i__ + ipoa - 1] - *ckon;
	}
	da_ .idall[*inb - 1] = illa;
	if (da_ .idall[*inb - 1] > da_ .idalm[*inb - 1]) {
	    s_wsle(&io___1607);
	    do_lio(&c__9, &c__1, "ERROR IN DACSU", 14L);
	    e_wsle();
 
	}
	return 0;
    }

    dacop_(ina, inb);

    if (da_ .nomax == 1) {
	da_ .cc[ipob - 1] -= *ckon;
	return 0;
    }

    dapek_(inb, jj, &const__);
    d__1 = const__ - *ckon;
    dapok_(inb, jj, &d__1);

    return 0;
}  


 
  int dasuc_(ina, ckon, inb)
integer *ina;
doublereal *ckon;
integer *inb;
{
     
    integer i__1;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer i__, illa, ilma, ilmb, illb, inoa, inob, ipoa, ipob, inva, 
	    invb;
    extern   int dainf_(), dacmu_(), dacsu_();

     
    static cilist io___1620 = { 0, 6, 0, 0, 0 };


 

 

 

 


    dainf_(ina, &inoa, &inva, &ipoa, &ilma, &illa);
    dainf_(inb, &inob, &invb, &ipob, &ilmb, &illb);

    if (inva == 0) {
	i__1 = illa - 1;
	for (i__ = 0; i__ <= i__1; ++i__) {
 
	    da_ .cc[i__ + ipob - 1] = - da_ .cc[i__ + ipoa - 1] + *ckon;
	}
	da_ .idall[*inb - 1] = illa;
	if (da_ .idall[*inb - 1] > da_ .idalm[*inb - 1]) {
	    s_wsle(&io___1620);
	    do_lio(&c__9, &c__1, "ERROR IN DASUC", 14L);
	    e_wsle();
 
	}
	return 0;
    }

    dacsu_(ina, ckon, inb);
    dacmu_(inb, &c_b2381, inb);

    return 0;
}  

 
 
  int dacmu_(ina, ckon, inc)
integer *ina;
doublereal *ckon;
integer *inc;
{
    static integer incc, illc, ilmc, inoc, ipoc, invc;
    extern   int dadal_(), daall_(), dainf_(), dacop_(), 
	    dacmut_();

 

 
 
 

 

 


    if (*ina == *inc) {
	dainf_(inc, &inoc, &invc, &ipoc, &ilmc, &illc);
	incc = 0;
	daall_(&incc, &c__1, "$$DAJUNK$$", &inoc, &invc, 10L);
	dacmut_(ina, ckon, &incc);
	dacop_(&incc, inc);
	dadal_(&incc, &c__1);
    } else {
	dacmut_(ina, ckon, inc);
    }
    return 0;
}  


 
  int dacmut_(ina, ckon, inb)
integer *ina;
doublereal *ckon;
integer *inb;
{
     
    integer i__1;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer i__, ia, ib, illa, ilma, ilmb, illb, inoa, inob, ipoa, 
	    ipob, inva, invb, minv;
    extern   int dachk_(), dainf_();

     
    static cilist io___1638 = { 0, 6, 0, 0, 0 };
    static cilist io___1642 = { 0, 6, 0, 0, 0 };


 

 
 
 

 

 


    dainf_(ina, &inoa, &inva, &ipoa, &ilma, &illa);
    dainf_(inb, &inob, &invb, &ipob, &ilmb, &illb);

    if (inva == 0) {
	i__1 = illa - 1;
	for (i__ = 0; i__ <= i__1; ++i__) {
 
	    da_ .cc[i__ + ipob - 1] = da_ .cc[i__ + ipoa - 1] * *ckon;
	}
	da_ .idall[*inb - 1] = illa;
	if (da_ .idall[*inb - 1] > da_ .idalm[*inb - 1]) {
	    s_wsle(&io___1638);
	    do_lio(&c__9, &c__1, "ERROR IN DACAD", 14L);
	    e_wsle();
 
	}
	return 0;
    }

    dachk_(ina, &inoa, &inva, &c__0, &c_n1, &c_n1, inb, &inob, &invb);

    if (da_ .nomax == 1) {
	minv = (( inva ) <= ( invb ) ? ( inva ) : ( invb )) ;
	i__1 = minv;
	for (i__ = 0; i__ <= i__1; ++i__) {
 
	    da_ .cc[ipob + i__ - 1] = da_ .cc[ipoa + i__ - 1] * *ckon;
	}
	i__1 = ipob + invb;
	for (i__ = ipob + minv + 1; i__ <= i__1; ++i__) {
 
	    da_ .cc[i__ - 1] = 0.;
	}
	return 0;
    }

    if ((( *ckon ) >= 0 ? ( *ckon ) : -( *ckon ))  < da_ .eps) {
	da_ .idall[*inb - 1] = 0;
	return 0;
    }

    ib = ipob - 1;

    i__1 = ipoa + illa - 1;
    for (ia = ipoa; ia <= i__1; ++ia) {

	if (da_ .ieo[da_ .ia1[da_ .i1[ia - 1]] + da_ .ia2[da_ .i2[ia - 1]] - 
		1] > da_ .nocut) {
	    goto L100;
	}
	++ib;
	da_ .cc[ib - 1] = da_ .cc[ia - 1] * *ckon;
	da_ .i1[ib - 1] = da_ .i1[ia - 1];
	da_ .i2[ib - 1] = da_ .i2[ia - 1];

L100:
	;
    }

    da_ .idall[*inb - 1] = ib - ipob + 1;
    if (da_ .idall[*inb - 1] > da_ .idalm[*inb - 1]) {
	s_wsle(&io___1642);
	do_lio(&c__9, &c__1, "ERROR IN DACMU ", 15L);
	e_wsle();
 
    }

    return 0;
}  


 
  int dacdi_(ina, ckon, inb)
integer *ina;
doublereal *ckon;
integer *inb;
{
     
    doublereal d__1;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    extern   int dacmu_();

     
    static cilist io___1643 = { 0, 6, 0, 0, 0 };


 

 

 

 


    if (*ckon == 0.) {
	s_wsle(&io___1643);
	do_lio(&c__9, &c__1, "ERROR IN DACDI, CKON IS ZERO", 28L);
	e_wsle();
 
    }

    d__1 = 1. / *ckon;
    dacmu_(ina, &d__1, inb);

    return 0;
}  


 
  int dadic_(ina, ckon, inc)
integer *ina;
doublereal *ckon;
integer *inc;
{
    static integer illc, ilmc, inoc, ipoc, invc;
    extern   int dacdi_(), dadal_(), daall_(), dainf_(), 
	    dacon_(), dafun_();
    static integer idadic;

 

 

 

 


    dainf_(inc, &inoc, &invc, &ipoc, &ilmc, &illc);

    if ((( *ckon ) >= 0 ? ( *ckon ) : -( *ckon ))  < da_ .eps) {
	dacon_(inc, &c_b251);
	return 0;
    }

    idadic = 0;

    daall_(&idadic, &c__1, "$$DADIC $$", &inoc, &invc, 10L);
    dacdi_(ina, ckon, &idadic);
    dafun_("INV   ", &idadic, inc, 6L);
    dadal_(&idadic, &c__1);

    return 0;
}  

 
 
  int dacma_(ina, inb, bfac, inc)
integer *ina, *inb;
doublereal *bfac;
integer *inc;
{
    static integer illc, ilmc, inoc, ipoc, invc;
    extern   int dadal_(), daall_(), dainf_(), dalin_(), 
	    dacop_();
    static integer idacma;

 

 

 
 


 

 


    dainf_(inc, &inoc, &invc, &ipoc, &ilmc, &illc);
    idacma = 0;
    daall_(&idacma, &c__1, "$$DACMA $$", &inoc, &invc, 10L);
    dalin_(ina, &c_b2366, inb, bfac, &idacma);
    dacop_(&idacma, inc);
    dadal_(&idacma, &c__1);

    return 0;
}  

 
 
  int daexc_(ina, ckon, inb)
integer *ina;
doublereal *ckon;
integer *inb;
{

    static integer illa, ilma, ilmb, illb, inoa, inob, ipoa, ipob, inva, invb;
    extern   int dadal_(), daall_(), dainf_(), dacmu_(), 
	    dafun_();
    static integer idaexc;

 

 

 

 


    dainf_(ina, &inoa, &inva, &ipoa, &ilma, &illa);
    dainf_(inb, &inob, &invb, &ipob, &ilmb, &illb);

    idaexc = 0;
    daall_(&idaexc, &c__1, "$$DAEXC $$", &inob, &invb, 10L);
    dafun_("LOG   ", ina, inb, 6L);
    dacmu_(inb, ckon, &idaexc);
    dafun_("EXP   ", &idaexc, inb, 6L);
    dadal_(&idaexc, &c__1);

    return 0;
}  


 
  int dacex_(ina, ckon, inb)
integer *ina;
doublereal *ckon;
integer *inb;
{

     
    integer s_wsle(), do_lio(), e_wsle();
    double log();

     
    static integer illa, ilma, ilmb, illb, inoa, inob, ipoa, ipob, inva, invb;
    extern   int dadal_(), daall_(), dainf_(), dacmu_(), 
	    dafun_();
    static integer idacex;

     
    static cilist io___1679 = { 0, 6, 0, 0, 0 };


 

 

 

 


    dainf_(ina, &inoa, &inva, &ipoa, &ilma, &illa);
    dainf_(inb, &inob, &invb, &ipob, &ilmb, &illb);

    if (*ckon <= 0.) {
	s_wsle(&io___1679);
	do_lio(&c__9, &c__1, "ERROR IN DACEX, CKON NOT POSITIVE", 33L);
	e_wsle();
 
    }

    idacex = 0;
    daall_(&idacex, &c__1, "$$DACEX $$", &inob, &invb, 10L);
    *ckon = log(*ckon);
    dacmu_(ina, ckon, &idacex);
    dafun_("EXP   ", &idacex, inb, 6L);
    dadal_(&idacex, &c__1);

    return 0;
}  


 
  int daexx_(ina, inb, inc)
integer *ina, *inb, *inc;
{

    static integer illa, ilma, ilmb, illb, ilmc, inoa, inob, ipoa, ipob, inoc,
	     inva, invb, invc, ipoc, illc;
    extern   int dadal_(), daall_(), dainf_(), dafun_(), 
	    damul_();
    static integer idaexx;

 

 

 

 


    dainf_(ina, &inoa, &inva, &ipoa, &ilma, &illa);
    dainf_(inb, &inob, &invb, &ipob, &ilmb, &illb);
    dainf_(inc, &inoc, &invc, &ipoc, &ilmc, &illc);

    idaexx = 0;
    daall_(&idaexx, &c__1, "$$DAEXX $$", &inoc, &invc, 10L);
    dafun_("LOG   ", ina, inc, 6L);
    damul_(inb, inc, &idaexx);
    dafun_("EXP   ", &idaexx, inc, 6L);
    dadal_(&idaexx, &c__1);

    return 0;
}  


 
  int dalin_(ina, afac, inb, bfac, inc)
integer *ina;
doublereal *afac;
integer *inb;
doublereal *bfac;
integer *inc;
{
    static integer incc, illc, ilmc, inoc, ipoc, invc;
    extern   int dadal_(), daall_(), dainf_(), dacop_(), 
	    dalint_();

 

 
 

 

 


    if (*ina == *inc || *inb == *inc) {
	dainf_(inc, &inoc, &invc, &ipoc, &ilmc, &illc);
	incc = 0;
	daall_(&incc, &c__1, "$$DAJUNK$$", &inoc, &invc, 10L);
	dalint_(ina, afac, inb, bfac, &incc);
	dacop_(&incc, inc);
	dadal_(&incc, &c__1);
    } else {
	dalint_(ina, afac, inb, bfac, inc);
    }
    return 0;
}  


 
  int dalint_(ina, afac, inb, bfac, inc)
integer *ina;
doublereal *afac;
integer *inb;
doublereal *bfac;
integer *inc;
{
     
    integer i__1;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer i__, ia, ib, ic, ja, jb, is;
    static doublereal ccc;
    static integer illa, ilma, ilmb, illb, ilmc, inoa, inob, ipoa, ipob, inoc,
	     inva, invb, invc, ipoc, illc;
    static doublereal copf;
    static integer minv;
    extern   int dachk_(), dainf_();
    static integer iamax, ibmax, icmax, ismin, ismax;

     
    static cilist io___1720 = { 0, 6, 0, 0, 0 };
    static cilist io___1735 = { 0, 6, 0, 0, 0 };


 

 
 

 

 


    dainf_(ina, &inoa, &inva, &ipoa, &ilma, &illa);
    dainf_(inb, &inob, &invb, &ipob, &ilmb, &illb);
    dainf_(inc, &inoc, &invc, &ipoc, &ilmc, &illc);

    dachk_(ina, &inoa, &inva, inb, &inob, &invb, inc, &inoc, &invc);

    if (inva + invb + invc == 0) {
	i__1 = (( illa ) <= ( illb ) ? ( illa ) : ( illb ))  - 1;
	for (i__ = 0; i__ <= i__1; ++i__) {
	    da_ .cc[ipoc + i__ - 1] = da_ .cc[ipoa + i__ - 1] * *afac + 
		    da_ .cc[ipob + i__ - 1] * *bfac;
 
	}
	da_ .idall[*inc - 1] = (( illa ) <= ( illb ) ? ( illa ) : ( illb )) ;
	if (da_ .idall[*inc - 1] > da_ .idalm[*inc - 1]) {
	    s_wsle(&io___1720);
	    do_lio(&c__9, &c__1, "ERROR IN DALIN ", 15L);
	    e_wsle();
 
	}
	return 0;
    }

    if (da_ .nomax == 1) {
 
	i__1 = (( inva ) <= ( invb ) ? ( inva ) : ( invb )) ;
	minv = (( i__1 ) <= ( invc ) ? ( i__1 ) : ( invc )) ;
	i__1 = minv;
	for (i__ = 0; i__ <= i__1; ++i__) {
 
	    da_ .cc[ipoc + i__ - 1] = da_ .cc[ipoa + i__ - 1] * *afac + 
		    da_ .cc[ipob + i__ - 1] * *bfac;
	}
	i__1 = ipoc + invc;
	for (i__ = ipoc + minv + 1; i__ <= i__1; ++i__) {
 
	    da_ .cc[i__ - 1] = 0.;
	}
	return 0;
    }
    ia = ipoa;
    ib = ipob;
    ic = ipoc - 1;
    iamax = ipoa + illa - 1;
    ibmax = ipob + illb - 1;
    icmax = ipoc + ilmc - 1;
    ja = da_ .ia1[da_ .i1[ia - 1]] + da_ .ia2[da_ .i2[ia - 1]];
    jb = da_ .ia1[da_ .i1[ib - 1]] + da_ .ia2[da_ .i2[ib - 1]];

    if (ia > iamax) {
	ismin = ib;
	ismax = ibmax;
	copf = *bfac;
	goto L50;
    }
    if (ib > ibmax) {
	ismin = ia;
	ismax = iamax;
	copf = *afac;
	goto L50;
    }

 
 

L10:
    if ((i__1 = ja - jb) < 0) {
	goto L30;
    } else if (i__1 == 0) {
	goto L20;
    } else {
	goto L40;
    }

 
 

L20:
    ccc = da_ .cc[ia - 1] * *afac + da_ .cc[ib - 1] * *bfac;
    if ((( ccc ) >= 0 ? ( ccc ) : -( ccc ))  < da_ .eps) {
	goto L25;
    }
    if (da_ .ieo[da_ .ia1[da_ .i1[ia - 1]] + da_ .ia2[da_ .i2[ia - 1]] - 1] > 
	    da_ .nocut) {
	goto L25;
    }
    ++ic;
    da_ .cc[ic - 1] = ccc;
    da_ .i1[ic - 1] = da_ .i1[ia - 1];
    da_ .i2[ic - 1] = da_ .i2[ia - 1];
L25:
    ++ia;
    ++ib;
    if (ia > iamax) {
	ismin = ib;
	ismax = ibmax;
	copf = *bfac;
	goto L50;
    }
    if (ib > ibmax) {
	ismin = ia;
	ismax = iamax;
	copf = *afac;
	goto L50;
    }
    ja = da_ .ia1[da_ .i1[ia - 1]] + da_ .ia2[da_ .i2[ia - 1]];
    jb = da_ .ia1[da_ .i1[ib - 1]] + da_ .ia2[da_ .i2[ib - 1]];
    goto L10;

 
 

L30:
    if (da_ .ieo[da_ .ia1[da_ .i1[ia - 1]] + da_ .ia2[da_ .i2[ia - 1]] - 1] > 
	    da_ .nocut) {
	goto L35;
    }
    ccc = da_ .cc[ia - 1] * *afac;
    if ((( ccc ) >= 0 ? ( ccc ) : -( ccc ))  < da_ .eps) {
	goto L35;
    }
    ++ic;
    da_ .cc[ic - 1] = ccc;
    da_ .i1[ic - 1] = da_ .i1[ia - 1];
    da_ .i2[ic - 1] = da_ .i2[ia - 1];
L35:
    ++ia;
    if (ia > iamax) {
	ismin = ib;
	ismax = ibmax;
	copf = *bfac;
	goto L50;
    }
    ja = da_ .ia1[da_ .i1[ia - 1]] + da_ .ia2[da_ .i2[ia - 1]];
    goto L10;

 
 

L40:
    if (da_ .ieo[da_ .ia1[da_ .i1[ib - 1]] + da_ .ia2[da_ .i2[ib - 1]] - 1] > 
	    da_ .nocut) {
	goto L45;
    }
    ccc = da_ .cc[ib - 1] * *bfac;
    if ((( ccc ) >= 0 ? ( ccc ) : -( ccc ))  < da_ .eps) {
	goto L45;
    }
    ++ic;
    da_ .cc[ic - 1] = ccc;
    da_ .i1[ic - 1] = da_ .i1[ib - 1];
    da_ .i2[ic - 1] = da_ .i2[ib - 1];
L45:
    ++ib;
    if (ib > ibmax) {
	ismin = ia;
	ismax = iamax;
	copf = *afac;
	goto L50;
    }
    jb = da_ .ia1[da_ .i1[ib - 1]] + da_ .ia2[da_ .i2[ib - 1]];
    goto L10;

 
 

L50:
    i__1 = ismax;
    for (is = ismin; is <= i__1; ++is) {
	if (da_ .ieo[da_ .ia1[da_ .i1[is - 1]] + da_ .ia2[da_ .i2[is - 1]] - 
		1] > da_ .nocut) {
	    goto L60;
	}
	ccc = da_ .cc[is - 1] * copf;
	if ((( ccc ) >= 0 ? ( ccc ) : -( ccc ))  < da_ .eps) {
	    goto L60;
	}
	++ic;
	da_ .cc[ic - 1] = ccc;
	da_ .i1[ic - 1] = da_ .i1[is - 1];
	da_ .i2[ic - 1] = da_ .i2[is - 1];
L60:
	;
    }

    da_ .idall[*inc - 1] = ic - ipoc + 1;

    if (da_ .idall[*inc - 1] > da_ .idalm[*inc - 1]) {
	s_wsle(&io___1735);
	do_lio(&c__9, &c__1, "ERROR IN DALIN, RESULT HAS TOO MANY TERMS ", 
		42L);
	e_wsle();
 
    }

    return 0;
}  


 
  int dafun2_(cf, ina, inb, inc, cf_len)
char *cf;
integer *ina, *inb, *inc;
ftnlen cf_len;
{
     

    static char abcs[30+1] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ    ";
    static char abcc[30+1] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ    ";

     
    static char fmt_1000[] = "(\002ERROR IN DAFUN, \002,a6,\002 DOES NOT EXIST FOR VECTORS \002,a10,a10,\002CONST TERMS  = \002,2e12.5)";

     
    doublereal d__1;

     
      int s_copy();
    integer i_indx(), s_cmp(), s_wsfe(), do_fio(), e_wsfe();
      int s_stop();
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer i__;
    static doublereal xa, xb;
    static char cfh[6];
    static integer ind;
    extern doublereal dare_();
    extern   int dacon_(), dacop_(), dadiv_(), dacmu_(), 
	    dafun_(), dasub_(), damul_();

     
    static cilist io___1744 = { 0, 6, 0, fmt_1000, 0 };
    static cilist io___1745 = { 0, 6, 0, fmt_1000, 0 };
    static cilist io___1746 = { 0, 6, 0, fmt_1000, 0 };
    static cilist io___1747 = { 0, 6, 0, fmt_1000, 0 };
    static cilist io___1748 = { 0, 6, 0, 0, 0 };


 

 

 

 

 




    if (*(unsigned char *)cf == ' ' || *(unsigned char *)cf == 'D') {
	s_copy(cfh, cf + 1, 5L, 5L);
	*(unsigned char *)&cfh[5] = ' ';
	s_copy(cf, cfh, 6L, 6L);
    }

    for (i__ = 1; i__ <= 6; ++i__) {
	ind = i_indx(abcs, cf + (i__ - 1), 30L, 1L);
	if (ind != 0) {
	    *(unsigned char *)&cf[i__ - 1] = *(unsigned char *)&abcc[ind - 1];
	}
 
    }

    if (s_cmp(cf, "MAX   ", 6L, 6L) == 0 || s_cmp(cf, "MAX0  ", 6L, 6L) == 0 
	    || s_cmp(cf, "AMAX1 ", 6L, 6L) == 0 || s_cmp(cf, "MAX1  ", 6L, 6L)
	     == 0) {
	xa = dare_(ina);
	xb = dare_(inb);
	if ((d__1 = xa - xb, (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) < 1e-12) {
	    s_wsfe(&io___1744);
	    do_fio(&c__1, cf, 6L);
	    do_fio(&c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&(*inb), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&xa, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&xb, (ftnlen)sizeof(doublereal));
	    e_wsfe();
	    s_stop("", 0L);
	} else if (xa > xb) {
	    dacop_(ina, inc);
	} else {
	    dacop_(inb, inc);
	}
    } else if (s_cmp(cf, "MIN   ", 6L, 6L) == 0 || s_cmp(cf, "MIN0  ", 6L, 6L)
	     == 0 || s_cmp(cf, "AMIN1 ", 6L, 6L) == 0 || s_cmp(cf, "MIN1  ", 
	    6L, 6L) == 0) {
	xa = dare_(ina);
	xb = dare_(inb);
	if ((d__1 = xa - xb, (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) < 1e-12) {
	    s_wsfe(&io___1745);
	    do_fio(&c__1, cf, 6L);
	    do_fio(&c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&(*inb), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&xa, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&xb, (ftnlen)sizeof(doublereal));
	    e_wsfe();
	    s_stop("", 0L);
	} else if (xa < xb) {
	    dacop_(ina, inc);
	} else {
	    dacop_(inb, inc);
	}
    } else if (s_cmp(cf, "DIM ", 6L, 4L) == 0 || s_cmp(cf, "IDIM ", 6L, 5L) ==
	     0) {
	xa = dare_(ina);
	xb = dare_(inb);
	if ((d__1 = xa - xb, (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) < 1e-12) {
	    s_wsfe(&io___1746);
	    do_fio(&c__1, cf, 6L);
	    do_fio(&c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&(*inb), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&xa, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&xb, (ftnlen)sizeof(doublereal));
	    e_wsfe();
	    s_stop("", 0L);
	} else if (xa > xb) {
	    dasub_(ina, inb, inc);
	} else {
	    dacon_(inc, &c_b251);
	}
    } else if (s_cmp(cf, "PROD  ", 6L, 6L) == 0) {
	damul_(ina, inb, inc);
    } else if (s_cmp(cf, "ATAN2", 6L, 5L) == 0) {
	dadiv_(ina, inb, inc);
	dafun_("ATAN  ", inc, inc, 6L);
    } else if (s_cmp(cf, "MOD   ", 6L, 6L) == 0 || s_cmp(cf, "AMOD  ", 6L, 6L)
	     == 0) {
	dadiv_(ina, inb, inc);
	dafun_("INT   ", inc, inc, 6L);
	damul_(inc, inb, inc);
	dasub_(ina, inc, inc);
    } else if (s_cmp(cf, "SIGN  ", 6L, 6L) == 0 || s_cmp(cf, "ISIGN ", 6L, 6L)
	     == 0) {
	xa = dare_(ina);
	xb = dare_(inb);
	dafun_("ABS   ", ina, inc, 6L);
	if ((( xb ) >= 0 ? ( xb ) : -( xb ))  < 1e-12) {
	    s_wsfe(&io___1747);
	    do_fio(&c__1, cf, 6L);
	    do_fio(&c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&(*inb), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&xa, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&xb, (ftnlen)sizeof(doublereal));
	    e_wsfe();
	    s_stop("", 0L);
	} else if (xb < 0.) {
	    dacmu_(inc, &c_b2381, inc);
	}
    } else {
	s_wsle(&io___1748);
	do_lio(&c__9, &c__1, "ERROR IN DAFUN2, UNKNOWN FUNCTION ", 34L);
	do_lio(&c__9, &c__1, cf, 6L);
	e_wsle();
    }


    return 0;
}  


 
  int dafun_(mycf, ina, inc, mycf_len)
char *mycf;
integer *ina, *inc;
ftnlen mycf_len;
{

     
      int s_copy();

     
    static char cf[6];
    static integer incc, illc, ilmc, inoc, ipoc, invc;
    extern   int dadal_(), daall_(), dainf_(), dacop_(), 
	    dafunt_();

 

 
 
 
 

 

 



    s_copy(cf, mycf, 6L, 6L);
    if (*ina == *inc) {
	dainf_(inc, &inoc, &invc, &ipoc, &ilmc, &illc);
	incc = 0;
	daall_(&incc, &c__1, "$$DAJUNK$$", &inoc, &invc, 10L);
	dafunt_(cf, ina, &incc, 6L);
	dacop_(&incc, inc);
	dadal_(&incc, &c__1);
    } else {
	dafunt_(cf, ina, inc, 6L);
    }
    return 0;
}  


 
  int dafunt_(cf, ina, inc, cf_len)
char *cf;
integer *ina, *inc;
ftnlen cf_len;
{
     

    static integer jj[20] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
    static char abcs[30+1] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ    ";
    static char abcc[30+1] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ    ";

     
    static char fmt_1000[] = "(\002ERROR IN DAFUN, \002,a4,\002 DOES NOT EXIST FOR VECTOR \002,a10,\002CONST TERM  = \002,e12.5)";

     
    integer i__1;
    doublereal d__1, d__2, d__3;

     
      int s_copy();
    integer i_indx(), s_cmp();
    double sqrt(), exp(), log(), sin(), cos(), tan(), asin(), acos(), atan(), 
	    sinh(), cosh(), tanh();
    integer s_wsle(), do_lio(), e_wsle(), s_wsfe(), do_fio(), e_wsfe();
      int s_stop();
    double pow_dd(), d_int();
    integer i_dnnt();
    double d_nint();

     
    static doublereal d__;
    static integer i__, l;
    static doublereal p, t, a0, a1, a2, a3, a4, a5, e2, e1, e3, e4, e5, x1, 
	    aa, ca, ea, ra;
    static integer ki;
    static doublereal sa, pi;
    static integer no;
    static doublereal xf[101], xn, aa0;
    static char cfh[6];
    static integer ind;
    static doublereal fak, spi, era, scr, rpi4;
    static integer illa, ilma, illc, ilmc, inoa, ipoa, inoc, ipoc, inva, invc,
	     inon, iscr, lfun, ipow;
    extern   int dacma_(), dadal_(), dachk_(), daall_(), 
	    dainf_(), dapek_(), dacop_(), dacon_(), dapok_(), damul_(), 
	    dasqr_();

     
    static cilist io___1793 = { 0, 6, 0, 0, 0 };
    static cilist io___1799 = { 0, 6, 0, fmt_1000, 0 };
    static cilist io___1802 = { 0, 6, 0, fmt_1000, 0 };
    static cilist io___1804 = { 0, 6, 0, fmt_1000, 0 };
    static cilist io___1807 = { 0, 6, 0, fmt_1000, 0 };
    static cilist io___1810 = { 0, 6, 0, fmt_1000, 0 };
    static cilist io___1811 = { 0, 6, 0, fmt_1000, 0 };
    static cilist io___1812 = { 0, 6, 0, fmt_1000, 0 };
    static cilist io___1813 = { 0, 6, 0, fmt_1000, 0 };
    static cilist io___1814 = { 0, 6, 0, 0, 0 };
    static cilist io___1815 = { 0, 6, 0, fmt_1000, 0 };
    static cilist io___1816 = { 0, 6, 0, 0, 0 };
    static cilist io___1817 = { 0, 6, 0, fmt_1000, 0 };
    static cilist io___1818 = { 0, 6, 0, 0, 0 };
    static cilist io___1819 = { 0, 6, 0, fmt_1000, 0 };
    static cilist io___1821 = { 0, 6, 0, 0, 0 };
    static cilist io___1822 = { 0, 6, 0, 0, 0 };
    static cilist io___1823 = { 0, 6, 0, 0, 0 };
    static cilist io___1824 = { 0, 6, 0, 0, 0 };
    static cilist io___1825 = { 0, 6, 0, 0, 0 };
    static cilist io___1826 = { 0, 6, 0, 0, 0 };
    static cilist io___1827 = { 0, 6, 0, fmt_1000, 0 };
    static cilist io___1828 = { 0, 6, 0, 0, 0 };
    static cilist io___1829 = { 0, 6, 0, 0, 0 };
    static cilist io___1830 = { 0, 6, 0, fmt_1000, 0 };
    static cilist io___1831 = { 0, 6, 0, 0, 0 };
    static cilist io___1832 = { 0, 6, 0, fmt_1000, 0 };
    static cilist io___1833 = { 0, 6, 0, 0, 0 };
    static cilist io___1834 = { 0, 6, 0, fmt_1000, 0 };
    static cilist io___1835 = { 0, 6, 0, 0, 0 };
    static cilist io___1839 = { 0, 6, 0, 0, 0 };
    static cilist io___1840 = { 0, 6, 0, 0, 0 };
    static cilist io___1842 = { 0, 6, 0, 0, 0 };
    static cilist io___1843 = { 0, 6, 0, fmt_1000, 0 };
    static cilist io___1844 = { 0, 6, 0, fmt_1000, 0 };
    static cilist io___1846 = { 0, 6, 0, fmt_1000, 0 };
    static cilist io___1847 = { 0, 6, 0, fmt_1000, 0 };
    static cilist io___1848 = { 0, 6, 0, fmt_1000, 0 };
    static cilist io___1849 = { 0, 6, 0, 0, 0 };


 

 
 
 
 

 

 




    if (*(unsigned char *)cf == ' ' || *(unsigned char *)cf == 'D') {
	s_copy(cfh, cf + 1, 5L, 5L);
	*(unsigned char *)&cfh[5] = ' ';
	s_copy(cf, cfh, 6L, 6L);
    }

    for (i__ = 1; i__ <= 6; ++i__) {
	ind = i_indx(abcs, cf + (i__ - 1), 30L, 1L);
	if (ind != 0) {
	    *(unsigned char *)&cf[i__ - 1] = *(unsigned char *)&abcc[ind - 1];
	}
 
    }

    dainf_(ina, &inoa, &inva, &ipoa, &ilma, &illa);
    dainf_(inc, &inoc, &invc, &ipoc, &ilmc, &illc);

 
 

    if (inva == 0) {
	if (s_cmp(cf, "INV   ", 6L, 6L) == 0) {
	    i__1 = ipoa + illa - 1;
	    for (i__ = ipoa; i__ <= i__1; ++i__) {
 
		da_ .cc[i__ + ipoc - ipoa - 1] = 1. / da_ .cc[i__ - 1];
	    }
	    return 0;
	} else if (s_cmp(cf, "SQRT  ", 6L, 6L) == 0) {
	    i__1 = ipoa + illa - 1;
	    for (i__ = ipoa; i__ <= i__1; ++i__) {
 
		da_ .cc[i__ + ipoc - ipoa - 1] = sqrt(da_ .cc[i__ - 1]);
	    }
	    return 0;
	} else if (s_cmp(cf, "ISRT  ", 6L, 6L) == 0) {
	    i__1 = ipoa + illa - 1;
	    for (i__ = ipoa; i__ <= i__1; ++i__) {
 
		da_ .cc[i__ + ipoc - ipoa - 1] = 1. / sqrt(da_ .cc[i__ - 1]);
	    }
	    return 0;
	} else if (s_cmp(cf, "EXP   ", 6L, 6L) == 0) {
	    i__1 = ipoa + illa - 1;
	    for (i__ = ipoa; i__ <= i__1; ++i__) {
 
		da_ .cc[i__ + ipoc - ipoa - 1] = exp(da_ .cc[i__ - 1]);
	    }
	    return 0;
	} else if (s_cmp(cf, "LOG   ", 6L, 6L) == 0) {
	    i__1 = ipoa + illa - 1;
	    for (i__ = ipoa; i__ <= i__1; ++i__) {
 
		da_ .cc[i__ + ipoc - ipoa - 1] = log(da_ .cc[i__ - 1]);
	    }
	    return 0;
	} else if (s_cmp(cf, "SIN   ", 6L, 6L) == 0) {
	    i__1 = ipoa + illa - 1;
	    for (i__ = ipoa; i__ <= i__1; ++i__) {
 
		da_ .cc[i__ + ipoc - ipoa - 1] = sin(da_ .cc[i__ - 1]);
	    }
	    return 0;
	} else if (s_cmp(cf, "COS   ", 6L, 6L) == 0) {
	    i__1 = ipoa + illa - 1;
	    for (i__ = ipoa; i__ <= i__1; ++i__) {
 
		da_ .cc[i__ + ipoc - ipoa - 1] = cos(da_ .cc[i__ - 1]);
	    }
	    return 0;
	} else if (s_cmp(cf, "TAN   ", 6L, 6L) == 0) {
	    i__1 = ipoa + illa - 1;
	    for (i__ = ipoa; i__ <= i__1; ++i__) {
 
		da_ .cc[i__ + ipoc - ipoa - 1] = tan(da_ .cc[i__ - 1]);
	    }
	    return 0;
	} else if (s_cmp(cf, "COT   ", 6L, 6L) == 0) {
	    i__1 = ipoa + illa - 1;
	    for (i__ = ipoa; i__ <= i__1; ++i__) {
 
		da_ .cc[i__ + ipoc - ipoa - 1] = cos(da_ .cc[i__ - 1]) / sin(
			da_ .cc[i__ - 1]);
	    }
	    return 0;
	} else if (s_cmp(cf, "ASIN  ", 6L, 6L) == 0) {
	    i__1 = ipoa + illa - 1;
	    for (i__ = ipoa; i__ <= i__1; ++i__) {
 
		da_ .cc[i__ + ipoc - ipoa - 1] = asin(da_ .cc[i__ - 1]);
	    }
	    return 0;
	} else if (s_cmp(cf, "ACOS  ", 6L, 6L) == 0) {
	    i__1 = ipoa + illa - 1;
	    for (i__ = ipoa; i__ <= i__1; ++i__) {
 
		da_ .cc[i__ + ipoc - ipoa - 1] = acos(da_ .cc[i__ - 1]);
	    }
	    return 0;
	} else if (s_cmp(cf, "ATAN  ", 6L, 6L) == 0) {
	    i__1 = ipoa + illa - 1;
	    for (i__ = ipoa; i__ <= i__1; ++i__) {
 
		da_ .cc[i__ + ipoc - ipoa - 1] = atan(da_ .cc[i__ - 1]);
	    }
	    return 0;
	} else if (s_cmp(cf, "ACOT  ", 6L, 6L) == 0) {
	    x1 = atan(1.) * 2.;
	    i__1 = ipoa + illa - 1;
	    for (i__ = ipoa; i__ <= i__1; ++i__) {
 
		da_ .cc[i__ + ipoc - ipoa - 1] = x1 - atan(da_ .cc[i__ - 1]);
	    }
	    return 0;
	} else if (s_cmp(cf, "SINH  ", 6L, 6L) == 0) {
	    i__1 = ipoa + illa - 1;
	    for (i__ = ipoa; i__ <= i__1; ++i__) {
 
		da_ .cc[i__ + ipoc - ipoa - 1] = sinh(da_ .cc[i__ - 1]);
	    }
	    return 0;
	} else if (s_cmp(cf, "COSH  ", 6L, 6L) == 0) {
	    i__1 = ipoa + illa - 1;
	    for (i__ = ipoa; i__ <= i__1; ++i__) {
 
		da_ .cc[i__ + ipoc - ipoa - 1] = cosh(da_ .cc[i__ - 1]);
	    }
	    return 0;
	} else if (s_cmp(cf, "TANH  ", 6L, 6L) == 0) {
	    i__1 = ipoa + illa - 1;
	    for (i__ = ipoa; i__ <= i__1; ++i__) {
 
		da_ .cc[i__ + ipoc - ipoa - 1] = tanh(da_ .cc[i__ - 1]);
	    }
	    return 0;
	} else if (s_cmp(cf, "COTH  ", 6L, 6L) == 0) {
	    i__1 = ipoa + illa - 1;
	    for (i__ = ipoa; i__ <= i__1; ++i__) {
 
		da_ .cc[i__ + ipoc - ipoa - 1] = 1. / tanh(da_ .cc[i__ - 1]);
	    }
	    return 0;
	} else if (s_cmp(cf, "ASNH  ", 6L, 6L) == 0) {
	    i__1 = ipoa + illa - 1;
	    for (i__ = ipoa; i__ <= i__1; ++i__) {
		aa = da_ .cc[i__ - 1];
 
		da_ .cc[i__ + ipoc - ipoa - 1] = log(aa + sqrt(aa * aa + 1.));
	    }
	    return 0;
	} else if (s_cmp(cf, "ACSH  ", 6L, 6L) == 0) {
	    i__1 = ipoa + illa - 1;
	    for (i__ = ipoa; i__ <= i__1; ++i__) {
		aa = da_ .cc[i__ - 1];
 
		da_ .cc[i__ + ipoc - ipoa - 1] = log(aa + sqrt(aa * aa - 1.));
	    }
	    return 0;
	} else if (s_cmp(cf, "ATNH  ", 6L, 6L) == 0) {
	    i__1 = ipoa + illa - 1;
	    for (i__ = ipoa; i__ <= i__1; ++i__) {
		aa = da_ .cc[i__ - 1];
 
		da_ .cc[i__ + ipoc - ipoa - 1] = log((aa + 1) / (1 - aa)) * 
			.5;
	    }
	    return 0;
	} else if (s_cmp(cf, "ACTH  ", 6L, 6L) == 0) {
	    i__1 = ipoa + illa - 1;
	    for (i__ = ipoa; i__ <= i__1; ++i__) {
		aa = da_ .cc[i__ - 1];
 
		da_ .cc[i__ + ipoc - ipoa - 1] = log((aa + 1) / (aa - 1)) * 
			.5;
	    }
	    return 0;
	} else if (s_cmp(cf, "ABF   ", 6L, 6L) == 0) {
	    i__1 = ipoa + illa - 1;
	    for (i__ = ipoa; i__ <= i__1; ++i__) {
 
		da_ .cc[i__ + ipoc - ipoa - 1] = 1. / (exp(da_ .cc[i__ - 1]) 
			+ 1.);
	    }
	    return 0;
	} else if (s_cmp(cf, "GAUS  ", 6L, 6L) == 0) {
	    i__1 = ipoa + illa - 1;
	    for (i__ = ipoa; i__ <= i__1; ++i__) {
		aa = da_ .cc[i__ - 1];
 
		da_ .cc[i__ + ipoc - ipoa - 1] = exp(-aa * aa);
	    }
	    return 0;
	} else if (s_cmp(cf, "ERF   ", 6L, 6L) == 0) {
	    a1 = .254829592;
	    a2 = -.284496736;
	    a3 = 1.421413741;
	    a4 = -1.453152027;
	    a5 = 1.061405429;
	    p = .3275911;
	    pi = atan(1.) * 4.;
	    spi = sqrt(pi) / 2.;
	    i__1 = ipoa + illa - 1;
	    for (i__ = ipoa; i__ <= i__1; ++i__) {
		aa = da_ .cc[i__ - 1];
		if ((( aa ) >= 0 ? ( aa ) : -( aa ))  < 1.) {
		    xn = aa;
		    fak = 1.;
		    l = 1;
		    x1 = l * xn / fak;
		    for (ki = 1; ki <= 20; ++ki) {
			l = -l;
			xn = xn * aa * aa;
			fak *= ki;
			d__ = (doublereal) ((ki << 1) + 1);
			x1 += l * xn / fak / d__;
 
		    }
		    e2 = x1 / spi;
		} else {
		    e1 = exp(-aa * aa);
		    t = 1. / (p * aa + 1);
		    e2 = 1 - t * (a1 + t * (a2 + t * (a3 + t * (a4 + t * a5)))
			    ) * e1;
		}
 
		da_ .cc[i__ + ipoc - ipoa - 1] = e2;
	    }
	    return 0;
	} else if (s_cmp(cf, "CORX  ", 6L, 6L) == 0) {
	    i__1 = ipoa + illa - 1;
	    for (i__ = ipoa; i__ <= i__1; ++i__) {
		aa = da_ .cc[i__ - 1];
		if (aa == 0.) {
		    da_ .cc[i__ - 1] = 1.;
		} else {
		    aa = sqrt(aa);
		    da_ .cc[i__ - 1] = cos(aa);
		}
 
	    }
	    return 0;
	} else if (s_cmp(cf, "SIDX  ", 6L, 6L) == 0) {
	    i__1 = ipoa + illa - 1;
	    for (i__ = ipoa; i__ <= i__1; ++i__) {
		aa = da_ .cc[i__ - 1];
		if (aa == 0.) {
		    da_ .cc[i__ - 1] = 1.;
		} else {
		    da_ .cc[i__ - 1] = sin(aa) / aa;
		}
 
	    }
	    return 0;
	} else if (s_cmp(cf, "SQR   ", 6L, 6L) == 0) {
	    i__1 = ipoa + illa - 1;
	    for (i__ = ipoa; i__ <= i__1; ++i__) {
 
		da_ .cc[i__ + ipoc - ipoa - 1] = da_ .cc[i__ - 1] * da_ .cc[
			i__ - 1];
	    }
	    return 0;
	} else if (s_cmp(cf, "LOG2  ", 6L, 6L) == 0) {
	    i__1 = ipoa + illa - 1;
	    for (i__ = ipoa; i__ <= i__1; ++i__) {
 
		da_ .cc[i__ + ipoc - ipoa - 1] = log(da_ .cc[i__ - 1]) / log(
			2.);
	    }
	    return 0;
	} else if (s_cmp(cf, "LOG10 ", 6L, 6L) == 0) {
	    i__1 = ipoa + illa - 1;
	    for (i__ = ipoa; i__ <= i__1; ++i__) {
 
		da_ .cc[i__ + ipoc - ipoa - 1] = log(da_ .cc[i__ - 1]) / log(
			10.);
	    }
	    return 0;

	} else {
	    s_wsle(&io___1793);
	    do_lio(&c__9, &c__1, "ERROR, UNSUPPORTED FUNCTION ", 28L);
	    do_lio(&c__9, &c__1, cf, 6L);
	    e_wsle();
	}
    }

 
 

    if (s_cmp(cf, "SQR   ", 6L, 6L) == 0) {
	dasqr_(ina, inc);
	return 0;
    } else if (s_cmp(cf, "REAL  ", 6L, 6L) == 0) {
	dacop_(ina, inc);
	return 0;
    } else if (s_cmp(cf, "FLOAT", 6L, 5L) == 0) {
	dacop_(ina, inc);
	return 0;
    } else if (s_cmp(cf, "SNGL  ", 6L, 6L) == 0) {
	dacop_(ina, inc);
	return 0;
    } else if (s_cmp(cf, "DBLE  ", 6L, 6L) == 0) {
	dacop_(ina, inc);
	return 0;
    }

 
 

    ipow = 0;
    inon = 0;
    iscr = 0;

    daall_(&ipow, &c__1, "$$DAFUN1$$", &inoc, &invc, 10L);
    daall_(&inon, &c__1, "$$DAFUN2$$", &inoc, &invc, 10L);
    daall_(&iscr, &c__1, "$$DAFUN3$$", &inoc, &invc, 10L);

    dachk_(ina, &inoa, &inva, &c__0, &c_n1, &c_n1, inc, &inoc, &invc);

    dapek_(ina, jj, &a0);

 
    i__1 = (( da_ .nocut ) <= ( inoa ) ? ( da_ .nocut ) : ( inoa )) ;
    no = (( i__1 ) <= ( inoc ) ? ( i__1 ) : ( inoc )) ;

 
 

    if (s_cmp(cf, "INV   ", 6L, 6L) == 0) {
 
	if (a0 == 0.) {
	    s_wsfe(&io___1799);
	    do_fio(&c__1, cf, 6L);
	    do_fio(&c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&a0, (ftnlen)sizeof(doublereal));
	    e_wsfe();
 
	    lfun = 0;
	    return 0;
	}
	xf[0] = 1. / a0;
	i__1 = no;
	for (i__ = 1; i__ <= i__1; ++i__) {
 
	    xf[i__] = -xf[i__ - 1] / a0;
	}

    } else if (s_cmp(cf, "SQRT  ", 6L, 6L) == 0) {
 
	if (a0 <= 0.) {
	    s_wsfe(&io___1802);
	    do_fio(&c__1, cf, 6L);
	    do_fio(&c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&a0, (ftnlen)sizeof(doublereal));
	    e_wsfe();
 
	    lfun = 0;
	    return 0;
	}
	ra = sqrt(a0);
	xf[0] = ra;
	i__1 = no;
	for (i__ = 1; i__ <= i__1; ++i__) {
 
	    xf[i__] = -xf[i__ - 1] / a0 / (doublereal) (i__ << 1) * ((i__ << 
		    1) - 3);
	}

    } else if (s_cmp(cf, "ISRT  ", 6L, 6L) == 0) {
 
	if (a0 <= 0.) {
	    s_wsfe(&io___1804);
	    do_fio(&c__1, cf, 6L);
	    do_fio(&c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&a0, (ftnlen)sizeof(doublereal));
	    e_wsfe();
 
	    lfun = 0;
	    return 0;
	}
	era = 1. / sqrt(a0);
	xf[0] = era;
	i__1 = no;
	for (i__ = 1; i__ <= i__1; ++i__) {
 
	    xf[i__] = -xf[i__ - 1] / a0 / (doublereal) (i__ << 1) * ((i__ << 
		    1) - 1);
	}

    } else if (s_cmp(cf, "EXP   ", 6L, 6L) == 0) {
 
	ea = exp(a0);
	xf[0] = ea;
	i__1 = no;
	for (i__ = 1; i__ <= i__1; ++i__) {
 
	    xf[i__] = xf[i__ - 1] / (doublereal) i__;
	}

    } else if (s_cmp(cf, "LOG   ", 6L, 6L) == 0 || s_cmp(cf, "ALOG  ", 6L, 6L)
	     == 0) {
 

	if (a0 <= 0.) {
	    s_wsfe(&io___1807);
	    do_fio(&c__1, cf, 6L);
	    do_fio(&c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&a0, (ftnlen)sizeof(doublereal));
	    e_wsfe();
 
	    lfun = 0;
	    return 0;
	}
	ea = log(a0);
	xf[0] = ea;
	xf[1] = 1. / a0;
	i__1 = no;
	for (i__ = 2; i__ <= i__1; ++i__) {
 
	    xf[i__] = -xf[i__ - 1] / a0 / (doublereal) i__ * (i__ - 1);
	}

    } else if (s_cmp(cf, "SIN   ", 6L, 6L) == 0) {
 

	sa = sin(a0);
	ca = cos(a0);
	xf[0] = sa;
	xf[1] = ca;
	i__1 = no;
	for (i__ = 2; i__ <= i__1; ++i__) {
 
	    xf[i__] = -xf[i__ - 2] / (doublereal) (i__ * (i__ - 1));
	}

    } else if (s_cmp(cf, "COS   ", 6L, 6L) == 0) {
 

	sa = sin(a0);
	ca = cos(a0);
	xf[0] = ca;
	xf[1] = -sa;
	i__1 = no;
	for (i__ = 2; i__ <= i__1; ++i__) {
 
	    xf[i__] = -xf[i__ - 2] / (doublereal) (i__ * (i__ - 1));
	}

    } else if (s_cmp(cf, "SIRX  ", 6L, 6L) == 0) {
 
	if (a0 != 0.) {
	    s_wsfe(&io___1810);
	    do_fio(&c__1, cf, 6L);
	    do_fio(&c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&a0, (ftnlen)sizeof(doublereal));
	    e_wsfe();
 
	    lfun = 0;
	    return 0;
	}
	xf[0] = 1.;
	i__1 = no;
	for (i__ = 1; i__ <= i__1; ++i__) {
 
	    xf[i__] = -xf[i__ - 1] / (doublereal) ((i__ << 1) * ((i__ << 1) + 
		    1));
	}

    } else if (s_cmp(cf, "CORX  ", 6L, 6L) == 0) {
 
	if (a0 != 0.) {
	    s_wsfe(&io___1811);
	    do_fio(&c__1, cf, 6L);
	    do_fio(&c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&a0, (ftnlen)sizeof(doublereal));
	    e_wsfe();
 
	    lfun = 0;
	    return 0;
	}
	xf[0] = 1.;
	i__1 = no;
	for (i__ = 1; i__ <= i__1; ++i__) {
 
	    xf[i__] = -xf[i__ - 1] / (doublereal) ((i__ << 1) * ((i__ << 1) - 
		    1));
	}

    } else if (s_cmp(cf, "SIDX  ", 6L, 6L) == 0) {
 
	if (a0 != 0.) {
	    s_wsfe(&io___1812);
	    do_fio(&c__1, cf, 6L);
	    do_fio(&c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&a0, (ftnlen)sizeof(doublereal));
	    e_wsfe();
 
	    lfun = 0;
	    return 0;
	}
	xf[0] = 1.;
	xf[1] = 0.;
	i__1 = no;
	for (i__ = 2; i__ <= i__1; ++i__) {
 
	    xf[i__] = -xf[i__ - 2] / (doublereal) (i__ * (i__ + 1));
	}

    } else if (s_cmp(cf, "TAN   ", 6L, 6L) == 0) {
	if ((d__1 = cos(a0), (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) < da_ .epsmac) {
	    s_wsfe(&io___1813);
	    do_fio(&c__1, cf, 6L);
	    do_fio(&c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&a0, (ftnlen)sizeof(doublereal));
	    e_wsfe();
 
	    lfun = 0;
	    return 0;
	}
	sa = sin(a0);
	ca = cos(a0);
	xf[0] = sa / ca;
	xf[1] = 1. / ca / ca;
	xf[2] = sa * 2. / ca / ca / ca / 2.;
	xf[3] = (ca * 2. * ca + sa * 6. * sa) / ca / ca / ca / ca / 6.;
	xf[4] = (sa * 16 + sa * 8. * sa * sa) / ca / ca / ca / ca / ca / 24.;
	xf[5] = (ca * 16. * ca + ca * 24. * ca * sa * sa + sa * 80. * sa + sa 
		* 40. * sa * sa * sa) / ca / ca / ca / ca / ca / ca / 120.;
	if (no > 5) {
	    s_wsle(&io___1814);
	    do_lio(&c__9, &c__1, "ERROR IN DAFUN, ", 16L);
	    do_lio(&c__9, &c__1, cf, 6L);
	    do_lio(&c__9, &c__1, " ONLY UP TO NO = 5", 18L);
	    e_wsle();
 
	    s_stop("", 0L);
	}
    } else if (s_cmp(cf, "COT   ", 6L, 6L) == 0) {
	if ((d__1 = sin(a0), (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) < da_ .epsmac) {
	    s_wsfe(&io___1815);
	    do_fio(&c__1, cf, 6L);
	    do_fio(&c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&a0, (ftnlen)sizeof(doublereal));
	    e_wsfe();
 
	    lfun = 0;
	    return 0;
	}
	sa = sin(a0);
	ca = cos(a0);
	xf[0] = ca / sa;
	xf[1] = -1. / sa / sa;
	xf[2] = ca * 2. / sa / sa / sa / 2.;
	xf[3] = -(sa * 2. * sa + ca * 6. * ca) / sa / sa / sa / sa / 6.;
	xf[4] = (ca * 16 + ca * 8. * ca * ca) / sa / sa / sa / sa / sa / 24.;
	xf[5] = -(sa * 16. * sa + sa * 24. * sa * ca * ca + ca * 80. * ca + 
		ca * 40. * ca * ca * ca) / sa / sa / sa / sa / sa / sa / 120.;
	if (no > 5) {
	    s_wsle(&io___1816);
	    do_lio(&c__9, &c__1, "ERROR IN DAFUN, ", 16L);
	    do_lio(&c__9, &c__1, cf, 6L);
	    do_lio(&c__9, &c__1, " ONLY UP TO NO = 5", 18L);
	    e_wsle();
 
	    s_stop("", 0L);
	}
    } else if (s_cmp(cf, "ASIN  ", 6L, 6L) == 0) {
	if (1. - (( a0 ) >= 0 ? ( a0 ) : -( a0 ))  <= 0.) {
	    s_wsfe(&io___1817);
	    do_fio(&c__1, cf, 6L);
	    do_fio(&c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&a0, (ftnlen)sizeof(doublereal));
	    e_wsfe();
 
	    lfun = 0;
	    return 0;
	}
	xf[0] = asin(a0);
	d__1 = 1. - a0 * a0;
	xf[1] = pow_dd(&d__1, &c_b464);
	xf[2] = a0 * pow_dd(&xf[1], &c_b4017) / 2.;
	xf[3] = (a0 * 2. * a0 + 1) * pow_dd(&xf[1], &c_b4018) / 6.;
	xf[4] = (a0 * 9 + a0 * 6. * a0 * a0) * pow_dd(&xf[1], &c_b4019) / 24.;
 
	d__1 = xf[1], d__2 = d__1, d__1 *= d__1, d__1 *= d__1;
	xf[5] = (a0 * 72. * a0 + 9 + a0 * 24. * a0 * a0 * a0) * (d__2 * (d__1 
		* d__1)) / 120.;
	if (no > 5) {
	    s_wsle(&io___1818);
	    do_lio(&c__9, &c__1, "ERROR IN DAFUN, ", 16L);
	    do_lio(&c__9, &c__1, cf, 6L);
	    do_lio(&c__9, &c__1, " ONLY UP TO NO = 5", 18L);
	    e_wsle();
	    s_stop("", 0L);
	}
    } else if (s_cmp(cf, "ACOS  ", 6L, 6L) == 0) {
	if (1. - (( a0 ) >= 0 ? ( a0 ) : -( a0 ))  <= 0.) {
 
	    s_wsfe(&io___1819);
	    do_fio(&c__1, cf, 6L);
	    do_fio(&c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&a0, (ftnlen)sizeof(doublereal));
	    e_wsfe();
	    lfun = 0;
	    return 0;
	}
	xf[0] = acos(a0);
	d__1 = 1. - a0 * a0;
	scr = pow_dd(&d__1, &c_b464);
	xf[1] = -scr;
	xf[2] = -a0 * pow_dd(&scr, &c_b4017) / 2.;
	xf[3] = -(a0 * 2. * a0 + 1) * pow_dd(&scr, &c_b4018) / 6.;
	xf[4] = -(a0 * 9 + a0 * 6. * a0 * a0) * pow_dd(&scr, &c_b4019) / 24.;
 
	d__1 = scr, d__2 = d__1, d__1 *= d__1, d__1 *= d__1;
	xf[5] = -(a0 * 72. * a0 + 9 + a0 * 24. * a0 * a0 * a0) * (d__2 * (
		d__1 * d__1)) / 120.;
	if (no > 5) {
	    s_wsle(&io___1821);
	    do_lio(&c__9, &c__1, "ERROR IN DAFUN, ", 16L);
	    do_lio(&c__9, &c__1, cf, 6L);
	    do_lio(&c__9, &c__1, " ONLY UP TO NO = 5", 18L);
	    e_wsle();
 
	}
    } else if (s_cmp(cf, "ATAN  ", 6L, 6L) == 0) {
 

	xf[0] = atan(a0);
	xf[1] = 1. / (a0 * a0 + 1.);
	xf[2] = -a0 * (xf[1] * xf[1]);
 
	d__1 = xf[1], d__2 = d__1;
	xf[3] = (a0 * a0 - .33333333333333331) * (d__2 * (d__1 * d__1));
 
	d__1 = xf[1], d__1 *= d__1;
	xf[4] = (a0 - a0 * a0 * a0) * (d__1 * d__1);
 
	d__1 = a0, d__1 *= d__1;
 
	d__2 = xf[1], d__3 = d__2, d__2 *= d__2;
	xf[5] = (d__1 * d__1 + .20000000000000001 - a0 * 2. * a0) * (d__3 * (
		d__2 * d__2));
	if (no > 5) {
	    s_wsle(&io___1822);
	    do_lio(&c__9, &c__1, "ERROR IN DAFUN, ", 16L);
	    do_lio(&c__9, &c__1, cf, 6L);
	    do_lio(&c__9, &c__1, " ONLY UP TO NO = 5", 18L);
	    e_wsle();
 
	}
    } else if (s_cmp(cf, "ACOT  ", 6L, 6L) == 0) {
	xf[0] = atan(1.) * 2. - atan(a0);
	scr = 1. / (a0 * a0 + 1.);
	xf[1] = -scr;
	xf[2] = a0 * (scr * scr);
 
	d__1 = scr, d__2 = d__1;
	xf[3] = -(a0 * a0 - .33333333333333331) * (d__2 * (d__1 * d__1));
 
	d__1 = scr, d__1 *= d__1;
	xf[4] = -(a0 - a0 * a0 * a0) * (d__1 * d__1);
 
	d__1 = a0, d__1 *= d__1;
 
	d__2 = scr, d__3 = d__2, d__2 *= d__2;
	xf[5] = -(d__1 * d__1 + .20000000000000001 - a0 * 2. * a0) * (d__3 * (
		d__2 * d__2));
	if (no > 5) {
	    s_wsle(&io___1823);
	    do_lio(&c__9, &c__1, "ERROR IN DAFUN, ", 16L);
	    do_lio(&c__9, &c__1, cf, 6L);
	    do_lio(&c__9, &c__1, " ONLY UP TO NO = 5", 18L);
	    e_wsle();
 
	}
    } else if (s_cmp(cf, "SINH  ", 6L, 6L) == 0) {
	sa = sinh(a0);
	ca = cosh(a0);
	xf[0] = sa;
	xf[1] = ca;
	xf[2] = sa / 2.;
	xf[3] = ca / 6.;
	xf[4] = sa / 24.;
	xf[5] = ca / 120.;
	if (no > 5) {
	    s_wsle(&io___1824);
	    do_lio(&c__9, &c__1, "ERROR IN DAFUN, ", 16L);
	    do_lio(&c__9, &c__1, cf, 6L);
	    do_lio(&c__9, &c__1, " ONLY UP TO NO = 5", 18L);
	    e_wsle();
 
	}
    } else if (s_cmp(cf, "COSH  ", 6L, 6L) == 0) {
	sa = sinh(a0);
	ca = cosh(a0);
	xf[0] = ca;
	xf[1] = sa;
	xf[2] = ca / 2.;
	xf[3] = sa / 6.;
	xf[4] = ca / 24.;
	xf[5] = sa / 120.;
	if (no > 5) {
	    s_wsle(&io___1825);
	    do_lio(&c__9, &c__1, "ERROR IN DAFUN, ", 16L);
	    do_lio(&c__9, &c__1, cf, 6L);
	    do_lio(&c__9, &c__1, " ONLY UP TO NO = 5", 18L);
	    e_wsle();
 
	}
    } else if (s_cmp(cf, "TANH  ", 6L, 6L) == 0) {
	sa = sinh(a0);
	ca = cosh(a0);
	xf[0] = sa / ca;
	xf[1] = 1. / ca / ca;
	xf[2] = sa * -2. / ca / ca / ca / 2.;
	xf[3] = (ca * -2. * ca + sa * 6. * sa) / ca / ca / ca / ca / 6.;
	xf[4] = (sa * 16. - sa * 8. * sa * sa) / ca / ca / ca / ca / ca / 24.;
	xf[5] = (ca * 16. * ca - ca * 24. * ca * sa * sa - sa * 80. * sa + sa 
		* 40. * sa * sa * sa) / ca / ca / ca / ca / ca / ca / 120.;
	if (no > 5) {
	    s_wsle(&io___1826);
	    do_lio(&c__9, &c__1, "ERROR IN DAFUN, ", 16L);
	    do_lio(&c__9, &c__1, cf, 6L);
	    do_lio(&c__9, &c__1, " ONLY UP TO NO = 5", 18L);
	    e_wsle();
 
	}
    } else if (s_cmp(cf, "COTH  ", 6L, 6L) == 0) {
	if ((d__1 = sinh(a0), (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) < da_ .epsmac) {
	    lfun = 0;
	    s_wsfe(&io___1827);
	    do_fio(&c__1, cf, 6L);
	    do_fio(&c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&a0, (ftnlen)sizeof(doublereal));
	    e_wsfe();
 
	    return 0;
	}
	sa = sinh(a0);
	ca = cosh(a0);
	xf[0] = ca / sa;
	xf[1] = -1. / sa / sa;
	xf[2] = ca * 2. / sa / sa / sa / 2.;
	xf[3] = (sa * 2. * sa - ca * 6. * ca) / sa / sa / sa / sa / 6.;
	xf[4] = (ca * 16 + ca * 8. * ca * ca) / sa / sa / sa / sa / sa / 24.;
	xf[5] = (sa * 16. * sa + sa * 24. * sa * ca * ca - ca * 80. * ca - ca 
		* 40. * ca * ca * ca) / sa / sa / sa / sa / sa / sa / 120.;
	if (no > 5) {
	    s_wsle(&io___1828);
	    do_lio(&c__9, &c__1, "ERROR IN DAFUN, ", 16L);
	    do_lio(&c__9, &c__1, cf, 6L);
	    do_lio(&c__9, &c__1, " ONLY UP TO NO = 5", 18L);
	    e_wsle();
 
	}
    } else if (s_cmp(cf, "ASNH  ", 6L, 6L) == 0) {
	xf[0] = log(a0 + sqrt(a0 * a0 + 1.));
	d__1 = a0 * a0 + 1.;
	xf[1] = pow_dd(&d__1, &c_b464);
	xf[2] = -a0 * pow_dd(&xf[1], &c_b4017) / 2.;
	xf[3] = (a0 * 2. * a0 - 1.) * pow_dd(&xf[1], &c_b4018) / 6.;
	xf[4] = (a0 * 9 - a0 * 6. * a0 * a0) * pow_dd(&xf[1], &c_b4019) / 24.;
 
	d__1 = xf[1], d__2 = d__1, d__1 *= d__1, d__1 *= d__1;
	xf[5] = (9 - a0 * 72. * a0 + a0 * 24. * a0 * a0 * a0) * (d__2 * (d__1 
		* d__1)) / 120.;
	if (no > 5) {
	    s_wsle(&io___1829);
	    do_lio(&c__9, &c__1, "ERROR IN DAFUN, ", 16L);
	    do_lio(&c__9, &c__1, cf, 6L);
	    do_lio(&c__9, &c__1, " ONLY UP TO NO = 5", 18L);
	    e_wsle();
 
	}
    } else if (s_cmp(cf, "ACSH  ", 6L, 6L) == 0) {
	if (1. - a0 >= 0.) {
	    lfun = 0;
	    s_wsfe(&io___1830);
	    do_fio(&c__1, cf, 6L);
	    do_fio(&c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&a0, (ftnlen)sizeof(doublereal));
	    e_wsfe();
 
	    return 0;
	}
	xf[0] = log(a0 + sqrt(a0 * a0 - 1.));
	d__1 = a0 * a0 - 1.;
	xf[1] = pow_dd(&d__1, &c_b464);
	xf[2] = -a0 * pow_dd(&xf[1], &c_b4017) / 2.;
	xf[3] = (a0 * 2. * a0 + 1.) * pow_dd(&xf[1], &c_b4018) / 6.;
	xf[4] = (a0 * -9 - a0 * 6. * a0 * a0) * pow_dd(&xf[1], &c_b4019) / 
		24.;
 
	d__1 = xf[1], d__2 = d__1, d__1 *= d__1, d__1 *= d__1;
	xf[5] = (a0 * 72. * a0 + 9 + a0 * 24. * a0 * a0 * a0) * (d__2 * (d__1 
		* d__1)) / 120.;
	if (no > 5) {
	    s_wsle(&io___1831);
	    do_lio(&c__9, &c__1, "ERROR IN DAFUN, ", 16L);
	    do_lio(&c__9, &c__1, cf, 6L);
	    do_lio(&c__9, &c__1, " ONLY UP TO NO = 5", 18L);
	    e_wsle();
 
	}
    } else if (s_cmp(cf, "ATNH  ", 6L, 6L) == 0) {
	if ((( a0 ) >= 0 ? ( a0 ) : -( a0 ))  - 1. >= 0.) {
	    lfun = 0;
	    s_wsfe(&io___1832);
	    do_fio(&c__1, cf, 6L);
	    do_fio(&c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&a0, (ftnlen)sizeof(doublereal));
	    e_wsfe();
 
	    return 0;
	}
	xf[0] = log((a0 + 1) / (1 - a0)) * .5;
	xf[1] = 1. / (1. - a0 * a0);
	xf[2] = a0 * (xf[1] * xf[1]);
 
	d__1 = xf[1], d__2 = d__1;
	xf[3] = (a0 * a0 + .33333333333333331) * (d__2 * (d__1 * d__1));
 
	d__1 = xf[1], d__1 *= d__1;
	xf[4] = (a0 + a0 * a0 * a0) * (d__1 * d__1);
 
	d__1 = a0, d__1 *= d__1;
 
	d__2 = xf[1], d__3 = d__2, d__2 *= d__2;
	xf[5] = (d__1 * d__1 + .20000000000000001 + a0 * 2. * a0) * (d__3 * (
		d__2 * d__2));
	if (no > 5) {
	    s_wsle(&io___1833);
	    do_lio(&c__9, &c__1, "ERROR IN DAFUN, ", 16L);
	    do_lio(&c__9, &c__1, cf, 6L);
	    do_lio(&c__9, &c__1, " ONLY UP TO NO = 5", 18L);
	    e_wsle();
 
	}
    } else if (s_cmp(cf, "ACTH  ", 6L, 6L) == 0) {
	if (1. - (( a0 ) >= 0 ? ( a0 ) : -( a0 ))  >= 0.) {
	    lfun = 0;
	    s_wsfe(&io___1834);
	    do_fio(&c__1, cf, 6L);
	    do_fio(&c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&a0, (ftnlen)sizeof(doublereal));
	    e_wsfe();
 
	    return 0;
	}
	xf[0] = log((a0 + 1) / (a0 - 1)) * .5;
	scr = 1. / (a0 * a0 - 1.);
	xf[1] = -scr;
	xf[2] = a0 * (scr * scr);
	xf[3] = (-a0 * a0 - .33333333333333331) * pow_dd(&scr, &c_b4017);
	xf[4] = (a0 + a0 * a0 * a0) * pow_dd(&scr, &c_b2415);
 
	d__1 = a0, d__1 *= d__1;
	xf[5] = (-.20000000000000001 - d__1 * d__1 - a0 * 2. * a0) * pow_dd(&
		scr, &c_b4018);
	if (no > 5) {
	    s_wsle(&io___1835);
	    do_lio(&c__9, &c__1, "ERROR IN DAFUN, ", 16L);
	    do_lio(&c__9, &c__1, cf, 6L);
	    do_lio(&c__9, &c__1, " ONLY UP TO NO = 5", 18L);
	    e_wsle();
 
	}
    } else if (s_cmp(cf, "ABF   ", 6L, 6L) == 0) {

 

 
 
	xf[0] = 1. / (exp(a0) + 1);
	e1 = exp(a0) * x1;
	e2 = e1 * e1;
	e3 = e2 * e1;
	e4 = e3 * e1;
	e5 = e4 * e1;
	xf[1] = x1 * (-e1);
	xf[2] = x1 * (e1 * -.5 + e2);
	xf[3] = x1 * (-e1 / 6. + e2 - e3);
	xf[4] = x1 * (-e1 / 24. + e2 * 7. / 12. - e3 * 3. / 2. + e4);
	xf[5] = x1 * (-e1 / 120. + e2 / 4. - e3 * 5. / 4. + e4 * 2. - e5);
	if (no > 5) {
	    s_wsle(&io___1839);
	    do_lio(&c__9, &c__1, "ERROR IN DAFUN, ", 16L);
	    do_lio(&c__9, &c__1, cf, 6L);
	    do_lio(&c__9, &c__1, " ONLY UP TO NO = 5", 18L);
	    e_wsle();
 
	}
    } else if (s_cmp(cf, "GAUS", 6L, 4L) == 0) {

 

	xf[0] = exp(-a0 * a0);
	xf[1] = a0 * -2. * x1;
	xf[2] = (a0 * 2. * a0 - 1.) * x1;
	xf[3] = (a0 * 12. - a0 * 8. * a0 * a0) / 6. * x1;
	xf[4] = (a0 * 16. * a0 * a0 * a0 - a0 * 48. * a0 + 12.) / 24. * x1;
	xf[5] = (a0 * -32. * a0 * a0 * a0 * a0 + a0 * 160. * a0 * a0 - a0 * 
		120.) / 120. * x1;
	if (no > 5) {
	    s_wsle(&io___1840);
	    do_lio(&c__9, &c__1, "ERROR IN DAFUN, ", 16L);
	    do_lio(&c__9, &c__1, cf, 6L);
	    do_lio(&c__9, &c__1, " ONLY UP TO NO = 5", 18L);
	    e_wsle();
 
	}
    } else if (s_cmp(cf, "ERF   ", 6L, 6L) == 0) {

 

 

	rpi4 = sqrt(atan(1.));
	e1 = exp(-a0 * a0) / rpi4;
	if (a0 < 1.) {
	    xn = a0;
	    fak = 1.;
	    l = 1;
	    x1 = l * xn / fak;
	    for (i__ = 1; i__ <= 20; ++i__) {
		l = -l;
		xn = xn * a0 * a0;
		fak *= i__;
		d__ = (doublereal) ((i__ << 1) + 1);
		x1 += l * xn / fak / d__;
 
	    }
	    xf[0] = x1 / rpi4;
	} else {
	    a1 = .254829592;
	    a2 = -.284496736;
	    a3 = 1.421413741;
	    a4 = -1.453152027;
	    a5 = 1.061405429;
	    p = (float).3275911;
	    t = 1. / (p * a0 + 1);
	    e2 = 1 - t * (a1 + t * (a2 + t * (a3 + t * (a4 + t * a5)))) * e1 *
		     rpi4;
	    xf[0] = e2;
	}
	xf[1] = e1;
	xf[2] = -a0 * e1;
	xf[3] = (a0 * 4. * a0 - 2.) / 6. * e1;
	xf[4] = (a0 * 12. - a0 * 8. * a0 * a0) / 24. * e1;
	xf[5] = (a0 * 16. * a0 * a0 * a0 - a0 * 48. * a0 + 12.) / 120. * e1;
	if (no > 5) {
	    s_wsle(&io___1842);
	    do_lio(&c__9, &c__1, "ERROR IN DAFUN, ", 16L);
	    do_lio(&c__9, &c__1, cf, 6L);
	    do_lio(&c__9, &c__1, " ONLY UP TO NO = 5", 18L);
	    e_wsle();
 
	}
    } else if (s_cmp(cf, "LOG2  ", 6L, 6L) == 0) {
 

	if (a0 <= 0.) {
	    s_wsfe(&io___1843);
	    do_fio(&c__1, cf, 6L);
	    do_fio(&c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&a0, (ftnlen)sizeof(doublereal));
	    e_wsfe();
 
	    lfun = 0;
	    return 0;
	}
	ea = log(a0);
	xf[0] = ea / log(2.);
	xf[1] = 1. / a0 / log(2.);
	i__1 = no;
	for (i__ = 2; i__ <= i__1; ++i__) {
 
	    xf[i__] = -xf[i__ - 1] / a0 / (doublereal) i__ * (i__ - 1);
	}
    } else if (s_cmp(cf, "LOG10 ", 6L, 6L) == 0 || s_cmp(cf, "ALOG10", 6L, 6L)
	     == 0) {
 

	if (a0 <= 0.) {
	    s_wsfe(&io___1844);
	    do_fio(&c__1, cf, 6L);
	    do_fio(&c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&a0, (ftnlen)sizeof(doublereal));
	    e_wsfe();
 
	    lfun = 0;
	    return 0;
	}
	ea = log(a0);
	xf[0] = ea / log(10.);
	xf[1] = 1. / a0 / log(10.);
	i__1 = no;
	for (i__ = 2; i__ <= i__1; ++i__) {
 
	    xf[i__] = -xf[i__ - 1] / a0 / (doublereal) i__ * (i__ - 1);
	}
    } else if (s_cmp(cf, "INT   ", 6L, 6L) == 0 || s_cmp(cf, "IFIX  ", 6L, 6L)
	     == 0 || s_cmp(cf, "IDINT ", 6L, 6L) == 0 || s_cmp(cf, "AINT  ", 
	    6L, 6L) == 0) {
	aa0 = d_int(&a0);
	if ((d__1 = i_dnnt(&a0) - a0, (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) < 1e-12) {
	    s_wsfe(&io___1846);
	    do_fio(&c__1, cf, 6L);
	    do_fio(&c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&a0, (ftnlen)sizeof(doublereal));
	    e_wsfe();
 
	    lfun = 0;
	    return 0;
	}
	xf[0] = aa0;
	i__1 = no;
	for (i__ = 1; i__ <= i__1; ++i__) {
 
	    xf[i__] = 0.;
	}
    } else if (s_cmp(cf, "NINT  ", 6L, 6L) == 0 || s_cmp(cf, "IDNINT", 6L, 6L)
	     == 0 || s_cmp(cf, "ANINT ", 6L, 6L) == 0) {
	aa0 = d_nint(&a0);
	if ((d__2 = (d__1 = i_dnnt(&a0) - a0, (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) - .5, (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) ) < 
		1e-12) {
	    s_wsfe(&io___1847);
	    do_fio(&c__1, cf, 6L);
	    do_fio(&c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&a0, (ftnlen)sizeof(doublereal));
	    e_wsfe();
 
	    lfun = 0;
	    return 0;
	}
	xf[0] = aa0;
	i__1 = no;
	for (i__ = 1; i__ <= i__1; ++i__) {
 
	    xf[i__] = 0.;
	}
    } else if (s_cmp(cf, "ABS   ", 6L, 6L) == 0 || s_cmp(cf, "IABS  ", 6L, 6L)
	     == 0) {
	aa0 = (( a0 ) >= 0 ? ( a0 ) : -( a0 )) ;
	if ((( a0 ) >= 0 ? ( a0 ) : -( a0 ))  < 1e-12) {
	    s_wsfe(&io___1848);
	    do_fio(&c__1, cf, 6L);
	    do_fio(&c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&a0, (ftnlen)sizeof(doublereal));
	    e_wsfe();
 
	    lfun = 0;
	    return 0;
	}
	xf[0] = aa0;
	if (a0 > 0.) {
	    xf[1] = 1.;
	} else {
	    xf[1] = -1.;
	}
	i__1 = no;
	for (i__ = 2; i__ <= i__1; ++i__) {
 
	    xf[i__] = 0.;
	}
    } else {
	s_wsle(&io___1849);
	do_lio(&c__9, &c__1, "ERROR, UNSUPPORTED FUNCTION ", 28L);
	do_lio(&c__9, &c__1, cf, 6L);
	e_wsle();
    }

    dacop_(ina, &inon);
    dacon_(inc, xf);
    dapok_(&inon, jj, &c_b251);
    dacon_(&ipow, &c_b2366);

    i__1 = (( no ) <= ( da_ .nocut ) ? ( no ) : ( da_ .nocut )) ;
    for (i__ = 1; i__ <= i__1; ++i__) {

	damul_(&inon, &ipow, &iscr);
	dacop_(&iscr, &ipow);
	dacma_(inc, &ipow, &xf[i__], inc);

 
    }


    dadal_(&iscr, &c__1);
    dadal_(&inon, &c__1);
    dadal_(&ipow, &c__1);

    return 0;
}  

 

 
  int daabs_(ina, anorm)
integer *ina;
doublereal *anorm;
{
     
    integer i__1;
    doublereal d__1;

     
    static integer i__, illa, ilma, inoa, ipoa, inva;
    extern   int dainf_();

 

 

 

 


    dainf_(ina, &inoa, &inva, &ipoa, &ilma, &illa);

    *anorm = 0.;
    i__1 = ipoa + illa - 1;
    for (i__ = ipoa; i__ <= i__1; ++i__) {
	*anorm += (d__1 = da_ .cc[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
 
    }

    return 0;
}  


 
  int dacom_(ina, inb, dnorm)
integer *ina, *inb;
doublereal *dnorm;
{
    static integer inc, illc, ilmc, inoc, ipoc, invc;
    extern   int dadal_(), daabs_(), daall_(), dainf_(), 
	    dasub_();
    static integer idacom;

 

 
 
 
 
    idacom = 0;
    dainf_(&inc, &inoc, &invc, &ipoc, &ilmc, &illc);
    daall_(&idacom, &c__1, "$$DACOM $$", &inoc, &invc, 10L);
    dasub_(ina, inb, &idacom);
    daabs_(&idacom, dnorm);
    dadal_(&idacom, &c__1);

    return 0;
}  

 
 
  int dapos_(ina, inc)
integer *ina, *inc;
{
     
    integer i__1;
    doublereal d__1;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer i__, ia, ib, inb, illa, ilma, ilmb, illb, inoa, inob, ipoa,
	     ipob, inva, invb;
    extern   int dachk_(), dainf_();

     
    static cilist io___1875 = { 0, 6, 0, 0, 0 };
    static cilist io___1878 = { 0, 6, 0, 0, 0 };


 

 


 

 


    dainf_(ina, &inoa, &inva, &ipoa, &ilma, &illa);
    dainf_(&inb, &inob, &invb, &ipob, &ilmb, &illb);

    if (inva == 0) {
	i__1 = illa - 1;
	for (i__ = 0; i__ <= i__1; ++i__) {
 
	    da_ .cc[ipob + i__ - 1] = (d__1 = da_ .cc[ipoa + i__ - 1], (( 
		    d__1 ) >= 0 ? (  		    d__1 ) : -(  		    d__1 )) );
	}
	da_ .idall[inb - 1] = da_ .idall[*ina - 1];
	if (da_ .idall[inb - 1] > da_ .idalm[inb - 1]) {
	    s_wsle(&io___1875);
	    do_lio(&c__9, &c__1, "ERROR IN DAPOS", 14L);
	    e_wsle();
 
	}
    }

    dachk_(ina, &inoa, &inva, &c__0, &c_n1, &c_n1, &inb, &inob, &invb);

    ib = ipob - 1;

    i__1 = ipoa + illa - 1;
    for (ia = ipoa; ia <= i__1; ++ia) {

	if (da_ .ieo[da_ .ia1[da_ .i1[ia - 1]] + da_ .ia2[da_ .i2[ia - 1]] - 
		1] > da_ .nocut) {
	    goto L100;
	}
	++ib;
	da_ .cc[ib - 1] = (d__1 = da_ .cc[ia - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
	da_ .i1[ib - 1] = da_ .i1[ia - 1];
	da_ .i2[ib - 1] = da_ .i2[ia - 1];

L100:
	;
    }

    da_ .idall[inb - 1] = ib - ipob + 1;
    if (da_ .idall[inb - 1] > da_ .idalm[inb - 1]) {
	s_wsle(&io___1878);
	do_lio(&c__9, &c__1, "ERROR IN DAPOS ", 15L);
	e_wsle();
 
    }

    return 0;
}  

 
 
  int dacct_(ma, ia, mb, ib, mc, ic)
integer *ma, *ia, *mb, *ib, *mc, *ic;
{
     
    integer i__1;

     
    static integer i__, ij, mon[20], illc, ilmc, inoc, ipoc, invc;
    extern   int dadal_(), daall_(), dainf_(), dacop_(), 
	    dacctt_();

 

 
 
 

 

 


     
    --mc;
    --mb;
    --ma;

     
    if (ma[1] == mc[1] || mb[1] == mc[1]) {
	dainf_(&mc[1], &inoc, &invc, &ipoc, &ilmc, &illc);
	i__1 = *ic;
	for (ij = 1; ij <= i__1; ++ij) {
 
	    mon[ij - 1] = 0;
	}
	daall_(mon, ic, "$$DAJUNK$$", &inoc, &invc, 10L);
	dacctt_(&ma[1], ia, &mb[1], ib, mon, ic);
	i__1 = *ic;
	for (i__ = 1; i__ <= i__1; ++i__) {
 
	    dacop_(&mon[i__ - 1], &mc[i__]);
	}
	dadal_(mon, ic);
    } else {
	dacctt_(&ma[1], ia, &mb[1], ib, &mc[1], ic);
    }
    return 0;
}  


 
  int dacctt_(mb, ib, mc, ic, ma, ia)
integer *mb, *ib, *mc, *ic, *ma, *ia;
{
     
    integer i__1, i__2;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer i__, jl, iv, jv, icc[100], iia, iib, iic;
    static doublereal ccf;
    static integer mon[101], illa, ilma, ilmb, illb, ilmc, inoa, inob, ipoa, 
	    ipob, inoc, inva, invb, invc, ipoc, illc;
    extern   int dacma_(), dadal_(), damch_(), daall_(), 
	    dainf_(), dacon_(), damul_(), mtree_();

     
    static cilist io___1905 = { 0, 6, 0, 0, 0 };
    static cilist io___1906 = { 0, 6, 0, 0, 0 };


 

 
 
 

 

 


 
 
 

 
 

     
    --ma;
    --mc;
    --mb;

     
    iia = ma[1];
    iib = mb[1];
    iic = mc[1];
    dainf_(&iia, &inoa, &inva, &ipoa, &ilma, &illa);
    dainf_(&iib, &inob, &invb, &ipob, &ilmb, &illb);
    dainf_(&iic, &inoc, &invc, &ipoc, &ilmc, &illc);

    damch_(&ma[1], ia);
    damch_(&mb[1], ib);

    if (*ia != *ib) {
	s_wsle(&io___1905);
	do_lio(&c__9, &c__1, "ERROR IN DACCT, IA .NE. IB", 26L);
	e_wsle();
 
    } else if (*ic != invb) {
	s_wsle(&io___1906);
	do_lio(&c__9, &c__1, "ERROR IN DACCT, IC.NE.INVB", 26L);
	e_wsle();
 
    }

 
 

    i__1 = *ib;
    for (i__ = 1; i__ <= i__1; ++i__) {
 
	icc[i__ - 1] = 0;
    }

    i__1 = da_ .nomax + 1;
    for (i__ = 1; i__ <= i__1; ++i__) {
 
	mon[i__ - 1] = 0;
    }

    daall_(icc, ib, "$$DACCT $$", & da_ .nomax, & da_ .nvmax, 10L);
    i__1 = da_ .nomax + 1;
    daall_(mon, &i__1, "$$DAMON $$", &inoc, &invc, 10L);

    mtree_(&mb[1], ib, icc, ib);

 
 

    i__1 = *ia;
    for (i__ = 1; i__ <= i__1; ++i__) {
	dacon_(&ma[i__], & da_ .cc[da_ .idapo[icc[i__ - 1] - 1] - 1]);
 
    }

    dacon_(mon, &c_b2366);

    i__1 = da_ .idall[icc[0] - 1] - 1;
    for (i__ = 1; i__ <= i__1; ++i__) {

	jl = da_ .i1[da_ .idapo[icc[0] - 1] + i__ - 1];
	jv = da_ .i2[da_ .idapo[icc[0] - 1] + i__ - 1];

	damul_(&mon[jl - 1], &mc[jv], &mon[jl]);

	i__2 = *ia;
	for (iv = 1; iv <= i__2; ++iv) {

	    ccf = da_ .cc[da_ .idapo[icc[iv - 1] - 1] + i__ - 1];
	    if ((( ccf ) >= 0 ? ( ccf ) : -( ccf ))  > da_ .eps) {
		dacma_(&ma[iv], &mon[jl], &ccf, &ma[iv]);
	    }

 
	}
    }

    i__2 = da_ .nomax + 1;
    dadal_(mon, &i__2);
    dadal_(icc, ib);

    return 0;
}  


 
  int datrk_(mb, ib, mc, ic, n, ma, ia)
integer *mb, *ib, *mc, *ic, *n, *ma, *ia;
{
     
    integer i__1, i__2, i__3, i__4;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer i__, j, k;
    static doublereal xf[20], xi[20];
    static integer mbb[20];
    extern   int daall_(), dapek_(), dapok_(), datree_(), 
	    dapush_();

     
    static cilist io___1914 = { 0, 6, 0, 0, 0 };


 

 
 

 
 

 

 

 



     
    --ma;
    --mc;
    --mb;

     
    if (da_ .idalm[mc[1] - 1] * (( *n ) >= 0 ? ( *n ) : -( *n ))  > da_ .idalm[ma[1] - 1]) {
	s_wsle(&io___1914);
	do_lio(&c__9, &c__1, "ERROR IN ROUTINE DATRK, IA.LT.IC*|N|", 36L);
	e_wsle();
 
    }

    daall_(mbb, ib, "$$DATRK $$", & da_ .nomax, & da_ .nvmax, 10L);

    datree_(&mb[1], ib, mbb, ib);

    i__1 = da_ .idall[mc[1] - 1];
    for (i__ = 1; i__ <= i__1; ++i__) {

	i__2 = *ic;
	for (j = 1; j <= i__2; ++j) {
	    dapek_(&mc[j], &i__, &xi[j - 1]);
	    i__3 = (i__ - 1) * *n + 1;
	    dapok_(&ma[j], &i__3, &xi[j - 1]);
 
	}
	i__2 = (( *n ) >= 0 ? ( *n ) : -( *n )) ;
	for (k = 2; k <= i__2; ++k) {

	    dapush_(mbb, ib, xi, xf);

	    if (*n < 0) {
	    }

	    i__3 = *ic;
	    for (j = 1; j <= i__3; ++j) {
		xi[j - 1] = xf[j - 1];
		i__4 = (i__ - 1) * *n + k;
		dapok_(&ma[j], &i__4, &xi[j - 1]);
 
	    }

 
	}
    }

    return 0;
}  

 
 
  int datree_(mb, ib, mc, ic)
integer *mb, *ib, *mc, *ic;
{
     
    integer i__1, i__2, i__3;
    doublereal d__1;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer i__, j, ii, jj[20], jl, jv[101], ic1, ic2, icc, iib, iic, 
	    ibi, ichk;
    static doublereal apek;
    static integer illb, ilmb, ilmc, illc, inob, inoc, ipob, ipoc, invb, invc,
	     jnon;
    extern   int dadcd_(), dadal_(), dapac_(), dancd_(), 
	    damch_(), daall_();
    static doublereal bbijj;
    extern   int dainf_(), dapek_(), daclr_();
    static doublereal chkjj;
    extern   int dapok_();
    static integer nterm, ntermf;

     
    static cilist io___1933 = { 0, 6, 0, 0, 0 };
    static cilist io___1948 = { 0, 6, 0, 0, 0 };
    static cilist io___1952 = { 0, 6, 0, 0, 0 };
    static cilist io___1953 = { 0, 6, 0, 0, 0 };
    static cilist io___1954 = { 0, 6, 0, 0, 0 };


 

 

 

 

 


 

 



 
 

     
    --mc;
    --mb;

     
    iib = mb[1];
    iic = mc[1];
    dainf_(&iib, &inob, &invb, &ipob, &ilmb, &illb);
    dainf_(&iic, &inoc, &invc, &ipoc, &ilmc, &illc);

    damch_(&mb[1], ib);
    damch_(&mc[1], ic);

    if (*ib != *ic) {
	s_wsle(&io___1933);
	do_lio(&c__9, &c__1, "ERROR IN DATREE, IB .NE. IC", 27L);
	e_wsle();
 
    }

 
 

    ichk = 0;
    daall_(&ichk, &c__1, "$$DATREE$$", & da_ .nomax, & da_ .nvmax, 10L);

 
 

    daclr_(&c__1);

    da_ .cc[0] = 1.;

    i__1 = *ib;
    for (i__ = 1; i__ <= i__1; ++i__) {
	i__2 = da_ .idapo[mb[i__] - 1] + da_ .idall[mb[i__] - 1] - 1;
	for (ibi = da_ .idapo[mb[i__] - 1]; ibi <= i__2; ++ibi) {
	    icc = da_ .ia1[da_ .i1[ibi - 1]] + da_ .ia2[da_ .i2[ibi - 1]];
	    if (da_ .ieo[icc - 1] > inob) {
		goto L90;
	    }
	    da_ .cc[icc - 1] = 1.;
L90:
	    ;
	}
 
    }

    i__1 = inob;
    for (ii = 1; ii <= i__1; ++ii) {

 

	i__2 = da_ .nmmax;
	for (i__ = 1; i__ <= i__2; ++i__) {
	    if (da_ .cc[i__ - 1] < .5) {
		goto L140;
	    }

	    jnon = 0;
	    dancd_(& da_ .i1[i__ - 1], & da_ .i2[i__ - 1], jj);
	    i__3 = invb;
	    for (j = 1; j <= i__3; ++j) {
		if (jj[j - 1] == 0) {
		    goto L130;
		}
		jnon = j;
		--jj[j - 1];
		dadcd_(jj, &ic1, &ic2);
		apek = da_ .cc[da_ .ia1[ic1] + da_ .ia2[ic2] - 1];
		++jj[j - 1];
		if (apek >= .5) {
		    goto L140;
		}
L130:
		;
	    }

	    if (jnon == 0) {
		goto L140;
	    }

 

	    --jj[jnon - 1];
	    dadcd_(jj, &ic1, &ic2);
	    da_ .cc[da_ .ia1[ic1] + da_ .ia2[ic2] - 1] = 1.;

L140:
	    ;
	}
 
    }

    dapac_(&ichk, &c__0);

 
 

    ntermf = da_ .idall[ichk - 1];

 
 

    for (i__ = 1; i__ <= 20; ++i__) {
 
	jj[i__ - 1] = 0;
    }

    i__1 = *ib;
    for (i__ = 1; i__ <= i__1; ++i__) {
	dapek_(&mb[i__], jj, &bbijj);
	da_ .i1[da_ .idapo[mc[i__] - 1] - 1] = 0;
	da_ .i2[da_ .idapo[mc[i__] - 1] - 1] = 0;
	da_ .cc[da_ .idapo[mc[i__] - 1] - 1] = bbijj;
 
    }

    dapek_(&ichk, jj, &chkjj);
    if (chkjj > .5) {
	dapok_(&ichk, jj, &c_b2381);
    } else {
	s_wsle(&io___1948);
	do_lio(&c__9, &c__1, "ERROR IN DATREE, ZEROTH ORDER TERM OF ICHK IS ZERO", 50L);
	e_wsle();
 
    }

    nterm = 1;

 
 

    i__1 = inob;
    for (jl = 1; jl <= i__1; ++jl) {
 
	jv[jl] = 0;
    }

    jl = 0;
    chkjj = 1.;

L200:
    if (jl == 0 && chkjj <= .5) {
	goto L250;
    }
    if (jl < inob && chkjj > .5) {
	++jl;
	++jj[0];
	jv[jl] = 1;
    } else if (jv[jl] == invb) {
	--jj[jv[jl] - 1];
	jv[jl] = 0;
	--jl;
	chkjj = 0.;
	goto L200;
    } else {
	--jj[jv[jl] - 1];
	++jv[jl];
	++jj[jv[jl] - 1];
    }

    dapek_(&ichk, jj, &chkjj);

    if (chkjj <= .5) {
	goto L200;
    }

    ++nterm;
    if (nterm > da_ .idalm[mc[1] - 1]) {
	s_wsle(&io___1952);
	do_lio(&c__9, &c__1, "ERROR IN DATREE, NTERM TOO LARGE", 32L);
	e_wsle();
 
    }

    dapok_(&ichk, jj, &c_b2381);

 
    i__1 = *ib;
    for (i__ = 1; i__ <= i__1; ++i__) {
	dapek_(&mb[i__], jj, &bbijj);
	da_ .i1[da_ .idapo[mc[i__] - 1] + nterm - 2] = jl;
	da_ .i2[da_ .idapo[mc[i__] - 1] + nterm - 2] = jv[jl];
	da_ .cc[da_ .idapo[mc[i__] - 1] + nterm - 2] = bbijj;
 
    }

    goto L200;

L250:

    i__1 = *ib;
    for (i__ = 1; i__ <= i__1; ++i__) {
 
	da_ .idall[mc[i__] - 1] = nterm;
    }

 
 

    if (nterm != ntermf || nterm != da_ .idall[ichk - 1]) {
	s_wsle(&io___1953);
	do_lio(&c__9, &c__1, "ERROR IN DATREE, NTERM, NTERMF, IDALL(ICHK) =  "
		, 47L);
	do_lio(&c__3, &c__1, (char *)&nterm, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)&ntermf, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& da_ .idall[ichk - 1], (ftnlen)sizeof(
		integer));
	e_wsle();
 
    }

    i__1 = da_ .idapo[ichk - 1] + nterm - 1;
    for (i__ = da_ .idapo[ichk - 1]; i__ <= i__1; ++i__) {
	if ((d__1 = da_ .cc[i__ - 1] + 1., (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > da_ .epsmac) {
	    s_wsle(&io___1954);
	    do_lio(&c__9, &c__1, "ERROR IN DATREE, NOT ALL TERMS IN ICHK ARE -1", 45L);
	    e_wsle();
 
	}
 
    }

    dadal_(&ichk, &c__1);

    return 0;
}  

 
 
  int dapush_(mc, ic, xi, xf)
integer *mc, *ic;
doublereal *xi, *xf;
{
     
    integer i__1, i__2;

     
    static integer i__, jl, iv, jv;
    static doublereal xm[101], xx;

 

 

 

 

 



     
    --xf;
    --xi;
    --mc;

     
    i__1 = *ic;
    for (i__ = 1; i__ <= i__1; ++i__) {
 
	xf[i__] = da_ .cc[da_ .idapo[mc[i__] - 1] - 1];
    }

    xm[0] = 1.;

    i__1 = da_ .idall[mc[1] - 1] - 1;
    for (i__ = 1; i__ <= i__1; ++i__) {

	jl = da_ .i1[da_ .idapo[mc[1] - 1] + i__ - 1];
	jv = da_ .i2[da_ .idapo[mc[1] - 1] + i__ - 1];
	xx = xm[jl - 1] * xi[jv];
	xm[jl] = xx;

	i__2 = *ic;
	for (iv = 1; iv <= i__2; ++iv) {
	    xf[iv] += da_ .cc[da_ .idapo[mc[iv] - 1] + i__ - 1] * xx;
 
	}
    }

    return 0;
}  

 
 
  int dainv_(ma, ia, mb, ib)
integer *ma, *ia, *mb, *ib;
{
     
    integer i__1;

     
    static integer i__;
    static doublereal x[20];
    static integer ij, jj[20], ml[20], illb, ilmb, inob, ipob, invb;
    extern   int dadal_(), daall_(), dainf_(), dapek_(), 
	    dacop_(), dapok_(), dainvt_();

 

 
 

 

 




     
    --mb;
    --ma;

     
    for (i__ = 1; i__ <= 20; ++i__) {
 
	jj[i__ - 1] = 0;
    }
    if (ma[1] == mb[1]) {
	dainf_(&mb[1], &inob, &invb, &ipob, &ilmb, &illb);
	i__1 = *ia;
	for (i__ = 1; i__ <= i__1; ++i__) {
 
	    dapok_(&ma[i__], jj, &c_b251);
	}
	i__1 = *ib;
	for (ij = 1; ij <= i__1; ++ij) {
 
	    ml[ij - 1] = 0;
	}
	daall_(ml, ib, "$$DAJUNK$$", &inob, &invb, 10L);
	dainvt_(&ma[1], ia, ml, ib);
	i__1 = *ib;
	for (i__ = 1; i__ <= i__1; ++i__) {
 
	    dacop_(&ml[i__ - 1], &mb[i__]);
	}
	dadal_(ml, ib);
    } else {
	i__1 = *ia;
	for (i__ = 1; i__ <= i__1; ++i__) {
	    dapek_(&ma[i__], jj, &x[i__ - 1]);
 
	    dapok_(&ma[i__], jj, &c_b251);
	}
	dainvt_(&ma[1], ia, &mb[1], ib);
	i__1 = *ia;
	for (i__ = 1; i__ <= i__1; ++i__) {
 
	    dapok_(&ma[i__], jj, &x[i__ - 1]);
	}
    }
    return 0;
}  

 

 
  int dainvt_(ma, ia, mb, ib)
integer *ma, *ia, *mb, *ib;
{
     
    integer i__1, i__2, i__3;
    doublereal d__1;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer i__, j, k;
    static doublereal aa[400]	 , ai[400]	 
;
    static integer ie, jj[20], ml[20], ms[20], ier, illa, ilma, ilmb, illb;
    static doublereal amjj;
    static integer inoa, inob, ipoa, ipob, inva, invb;
    static doublereal prod;
    extern   int dadal_(), damch_(), daall_(), dacct_(), 
	    dainf_(), dacon_(), dapek_(), dacmu_(), dapok_();
    static doublereal amsjj;
    static integer nocut0;
    extern   int matinv_();

     
    static cilist io___1982 = { 0, 6, 0, 0, 0 };
    static cilist io___1983 = { 0, 6, 0, 0, 0 };
    static cilist io___1994 = { 0, 6, 0, 0, 0 };
    static cilist io___1996 = { 0, 6, 0, 0, 0 };


 

 
 

 

 




     
    --mb;
    --ma;

     
    dainf_(&ma[1], &inoa, &inva, &ipoa, &ilma, &illa);
    dainf_(&mb[1], &inob, &invb, &ipob, &ilmb, &illb);

 
 

    damch_(&ma[1], ia);
    damch_(&mb[1], ib);
 
    i__1 = *ib;
    for (ie = 1; ie <= i__1; ++ie) {
 
	dacon_(&mb[ie], &c_b251);
    }
 

    if (*ia != *ib) {
	s_wsle(&io___1982);
	do_lio(&c__9, &c__1, "ERROR IN DAINV, IA .NE. IB", 26L);
	e_wsle();
 
    } else if (*ia != inva || *ib != invb) {
	s_wsle(&io___1983);
	do_lio(&c__9, &c__1, "ERROR IN DAINV, IA.NE.INVA.OR.IB.NE.INVB", 40L);
	e_wsle();
 
    }

 
 

    i__1 = *ia;
    for (i__ = 1; i__ <= i__1; ++i__) {
	ms[i__ - 1] = 0;
	ml[i__ - 1] = 0;
 
    }

    daall_(ms, ia, "$$INV   $$", &inoa, &inva, 10L);
    daall_(ml, ia, "$$INVL  $$", &inoa, &inva, 10L);

 
 

    i__1 = *ib;
    for (i__ = 1; i__ <= i__1; ++i__) {
	i__2 = *ib;
	for (j = 1; j <= i__2; ++j) {
	    i__3 = *ib;
	    for (k = 1; k <= i__3; ++k) {
 
		jj[k - 1] = 0;
	    }
	    jj[j - 1] = 1;
	    dapek_(&ma[i__], jj, &amjj);
	    if ((( amjj ) >= 0 ? ( amjj ) : -( amjj ))  > da_ .eps) {
		dapok_(&ma[i__], jj, &c_b251);
	    }
 
	    aa[i__ + j * 20 - 21] = amjj;
	}
	dacmu_(&ma[i__], &c_b2381, &ma[i__]);
 
    }

 
 

    matinv_(aa, ai, ia, &c__20, &ier);

    if (ier == 132) {
	s_wsle(&io___1994);
	do_lio(&c__9, &c__1, "ERROR IN ROUTINE DAINV", 22L);
	e_wsle();
 
    }

    ier = 0;
    i__1 = *ib;
    for (i__ = 1; i__ <= i__1; ++i__) {
	i__2 = *ib;
	for (j = 1; j <= i__2; ++j) {
	    prod = 0.;
	    i__3 = *ib;
	    for (k = 1; k <= i__3; ++k) {
		jj[k - 1] = 0;
 
		prod += aa[i__ + k * 20 - 21] * ai[k + j * 20 - 21];
	    }
	    if (i__ == j) {
		prod += -1.;
	    }
	    if ((( prod ) >= 0 ? ( prod ) : -( prod ))  > da_ .epsmac * 100) {
		s_wsle(&io___1996);
		do_lio(&c__9, &c__1, "ERROR IN DAINV, INVERSION DID NOT WORK,I,J,PROD = ", 50L);
		do_lio(&c__3, &c__1, (char *)&i__, (ftnlen)sizeof(integer));
		do_lio(&c__3, &c__1, (char *)&j, (ftnlen)sizeof(integer));
		do_lio(&c__5, &c__1, (char *)&prod, (ftnlen)sizeof(doublereal)
			);
		e_wsle();
		ier = 1;
	    }
 
	    if ((( prod ) >= 0 ? ( prod ) : -( prod ))  > da_ .epsmac * 100) {
		return 0;
	    }
 
	    jj[j - 1] = 1;
	    dapok_(&mb[i__], jj, &ai[i__ + j * 20 - 21]);
	    dapok_(&ml[i__ - 1], jj, &ai[i__ + j * 20 - 21]);
 
	}
    }

 

 
 

 


    nocut0 = da_ .nocut;

    i__2 = da_ .nocut;
    for (i__ = 2; i__ <= i__2; ++i__) {

	da_ .nocut = i__;

	dacct_(&ma[1], ia, &mb[1], ib, ms, ia);
	i__1 = *ib;
	for (j = 1; j <= i__1; ++j) {
	    i__3 = *ib;
	    for (k = 1; k <= i__3; ++k) {
 
		jj[k - 1] = 0;
	    }
	    jj[j - 1] = 1;
	    dapek_(&ms[j - 1], jj, &amsjj);
	    d__1 = amsjj + 1.;
	    dapok_(&ms[j - 1], jj, &d__1);
 
	}

	dacct_(ml, ia, ms, ia, &mb[1], ib);

 
    }

    da_ .nocut = nocut0;

 
 

    i__2 = *ib;
    for (i__ = 1; i__ <= i__2; ++i__) {
	dacmu_(&ma[i__], &c_b2381, &ma[i__]);
	i__1 = *ib;
	for (j = 1; j <= i__1; ++j) {
	    i__3 = *ib;
	    for (k = 1; k <= i__3; ++k) {
 
		jj[k - 1] = 0;
	    }
	    jj[j - 1] = 1;
	    dapok_(&ma[i__], jj, &aa[i__ + j * 20 - 21]);
 
	}
    }

    dadal_(ml, ia);
    dadal_(ms, ia);

    return 0;
}  


 
  int damati_(a, ai, n, nmx, ier)
doublereal *a, *ai;
integer *n, *nmx, *ier;
{
     
    integer a_dim1, a_offset, ai_dim1, ai_offset, i__1, i__2;

     
    static doublereal d__;
    static integer i__, j;
    static doublereal aw[10000]	 ;
    static integer indx[100];
    extern   int daludc_(), dalubk_();

 

 
 
 
 
 
 

     
    ai_dim1 = *nmx;
    ai_offset = ai_dim1 + 1;
    ai -= ai_offset;
    a_dim1 = *nmx;
    a_offset = a_dim1 + 1;
    a -= a_offset;

     
    i__1 = *n;
    for (i__ = 1; i__ <= i__1; ++i__) {
	i__2 = *n;
	for (j = 1; j <= i__2; ++j) {
	    aw[i__ + j * 100 - 101] = a[i__ + j * a_dim1];
 
	    ai[i__ + j * ai_dim1] = (float)0.;
	}
 
	ai[i__ + i__ * ai_dim1] = (float)1.;
    }
    daludc_(aw, n, &c__100, indx, &d__, ier);
    if (*ier == 132) {
	return 0;
    }
    i__1 = *n;
    for (j = 1; j <= i__1; ++j) {
 
	dalubk_(aw, n, &c__100, indx, &ai[j * ai_dim1 + 1], nmx);
    }

    return 0;
}  


 
  int daludc_(a, n, np, indx, d__, ier)
doublereal *a;
integer *n, *np, *indx;
doublereal *d__;
integer *ier;
{
     
    integer a_dim1, a_offset, i__1, i__2, i__3;
    doublereal d__1, d__2;

     
    static integer i__, j, k;
    static doublereal vv[100], dum, sum;
    static integer imax;
    static doublereal aamax;

 

 
 
 
 
 

 

     
    --indx;
    a_dim1 = *np;
    a_offset = a_dim1 + 1;
    a -= a_offset;

     
    *ier = (float)0.;
    *d__ = (float)1.;
    i__1 = *n;
    for (i__ = 1; i__ <= i__1; ++i__) {
	aamax = (float)0.;
	i__2 = *n;
	for (j = 1; j <= i__2; ++j) {
	    if ((d__1 = a[i__ + j * a_dim1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > aamax) {
		aamax = (d__2 = a[i__ + j * a_dim1], (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) );
	    }
 
	}
	if (aamax == (float)0.) {
	    *ier = 132;
	    return 0;
	}
	vv[i__ - 1] = (float)1. / aamax;
 
    }
    i__1 = *n;
    for (j = 1; j <= i__1; ++j) {
	if (j > 1) {
	    i__2 = j - 1;
	    for (i__ = 1; i__ <= i__2; ++i__) {
		sum = a[i__ + j * a_dim1];
		if (i__ > 1) {
		    i__3 = i__ - 1;
		    for (k = 1; k <= i__3; ++k) {
			sum -= a[i__ + k * a_dim1] * a[k + j * a_dim1];
 
		    }
		    a[i__ + j * a_dim1] = sum;
		}
 
	    }
	}
	aamax = (float)0.;
	i__2 = *n;
	for (i__ = j; i__ <= i__2; ++i__) {
	    sum = a[i__ + j * a_dim1];
	    if (j > 1) {
		i__3 = j - 1;
		for (k = 1; k <= i__3; ++k) {
		    sum -= a[i__ + k * a_dim1] * a[k + j * a_dim1];
 
		}
		a[i__ + j * a_dim1] = sum;
	    }
	    dum = vv[i__ - 1] * (( sum ) >= 0 ? ( sum ) : -( sum )) ;
	    if (dum >= aamax) {
		imax = i__;
		aamax = dum;
	    }
 
	}
	if (j != imax) {
	    i__2 = *n;
	    for (k = 1; k <= i__2; ++k) {
		dum = a[imax + k * a_dim1];
		a[imax + k * a_dim1] = a[j + k * a_dim1];
		a[j + k * a_dim1] = dum;
 
	    }
	    *d__ = -(*d__);
	    vv[imax - 1] = vv[j - 1];
	}
	indx[j] = imax;
	if (j != *n) {
	    if (a[j + j * a_dim1] == (float)0.) {
		a[j + j * a_dim1] = 1e-20;
	    }
	    dum = (float)1. / a[j + j * a_dim1];
	    i__2 = *n;
	    for (i__ = j + 1; i__ <= i__2; ++i__) {
		a[i__ + j * a_dim1] *= dum;
 
	    }
	}
 
    }
    if (a[*n + *n * a_dim1] == (float)0.) {
	a[*n + *n * a_dim1] = 1e-20;
    }
    return 0;
}  

 
 
  int dalubk_(a, n, np, indx, b, nmx)
doublereal *a;
integer *n, *np, *indx;
doublereal *b;
integer *nmx;
{
     
    integer a_dim1, a_offset, i__1, i__2;

     
    static integer i__, j, ii, ll;
    static doublereal sum;

 

 
 
 
 
 
 

 

     
    --indx;
    a_dim1 = *np;
    a_offset = a_dim1 + 1;
    a -= a_offset;
    --b;

     
    ii = 0;
    i__1 = *n;
    for (i__ = 1; i__ <= i__1; ++i__) {
	ll = indx[i__];
	sum = b[ll];
	b[ll] = b[i__];
	if (ii != 0) {
	    i__2 = i__ - 1;
	    for (j = ii; j <= i__2; ++j) {
		sum -= a[i__ + j * a_dim1] * b[j];
 
	    }
	} else if (sum != (float)0.) {
	    ii = i__;
	}
	b[i__] = sum;
 
    }
    for (i__ = *n; i__ >= 1; --i__) {
	sum = b[i__];
	if (i__ < *n) {
	    i__1 = *n;
	    for (j = i__ + 1; j <= i__1; ++j) {
		sum -= a[i__ + j * a_dim1] * b[j];
 
	    }
	}
	b[i__] = sum / a[i__ + i__ * a_dim1];
 
    }
    return 0;
}  

 
 
  int dapin_(ma, ia, mb, ib, jind)
integer *ma, *ia, *mb, *ib, *jind;
{
     
    integer i__1, i__2;

     
    static integer i__, k, me[20], jj[20], mi[20], mn[20], illa, ilma, inoa, 
	    ipoa, inva;
    extern   int dadal_(), daall_(), dacct_(), dainf_(), 
	    dacop_(), dapok_(), dainv_();

 

 

 


 

 



     
    --jind;
    --mb;
    --ma;

     
    dainf_(&ma[1], &inoa, &inva, &ipoa, &ilma, &illa);

    i__1 = *ia;
    for (i__ = 1; i__ <= i__1; ++i__) {
	mn[i__ - 1] = 0;
	mi[i__ - 1] = 0;
	me[i__ - 1] = 0;
 
    }

    daall_(mn, ia, "$$PIN1  $$", &inoa, &inva, 10L);
    daall_(mi, ia, "$$PIN2  $$", &inoa, &inva, 10L);
    daall_(me, ia, "$$PIN3  $$", &inoa, &inva, 10L);

    i__1 = *ia;
    for (i__ = 1; i__ <= i__1; ++i__) {
	i__2 = da_ .nvmax;
	for (k = 1; k <= i__2; ++k) {
 
	    jj[k - 1] = 0;
	}
	jj[i__ - 1] = 1;
 
	dapok_(&me[i__ - 1], jj, &c_b2366);
    }

    i__1 = *ia;
    for (i__ = 1; i__ <= i__1; ++i__) {
	dacop_(&ma[i__], &mn[i__ - 1]);
	if (jind[i__] == 0) {
	    dacop_(&me[i__ - 1], &mn[i__ - 1]);
	}
 
    }

    dainv_(mn, ia, mi, ia);

    i__1 = *ia;
    for (i__ = 1; i__ <= i__1; ++i__) {
	if (jind[i__] == 0) {
	    dacop_(&ma[i__], &me[i__ - 1]);
	}
 
    }

    dacct_(me, ia, mi, ia, &mb[1], ib);

    dadal_(me, ia);
    dadal_(mi, ia);
    dadal_(mn, ia);

    return 0;
}  

 

 
  int dader_(idif, ina, inc)
integer *idif, *ina, *inc;
{
    static integer incc, illc, ilmc, inoc, ipoc, invc;
    extern   int dadal_(), daall_(), dainf_(), dacop_(), 
	    dadert_();

 

 

 

 

 


    if (*ina == *inc) {
	dainf_(inc, &inoc, &invc, &ipoc, &ilmc, &illc);
	incc = 0;
	daall_(&incc, &c__1, "$$DAJUNK$$", &inoc, &invc, 10L);
	dadert_(idif, ina, &incc);
	dacop_(&incc, inc);
	dadal_(&incc, &c__1);
    } else {
	dadert_(idif, ina, inc);
    }
    return 0;
}  


 
  int dadert_(idif, ina, inc)
integer *idif, *ina, *inc;
{
     
    integer i__1;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer i__;
    static doublereal x;
    static integer ic, jj, iee, ifac, illa, ilma, illc, ilmc, inoa, ipoa, 
	    inoc, ipoc, inva, invc, ider1, ider2;
    extern   int dachk_(), dainf_();
    static integer ibase;
    static doublereal xdivi;
    static integer ider1s, ider2s;

     
    static cilist io___2044 = { 0, 6, 0, 0, 0 };
    static cilist io___2045 = { 0, 6, 0, 0, 0 };
    static cilist io___2058 = { 0, 6, 0, 0, 0 };


 

 

 

 

 


    dainf_(ina, &inoa, &inva, &ipoa, &ilma, &illa);
    dainf_(inc, &inoc, &invc, &ipoc, &ilmc, &illc);

    if (inva == 0 || invc == 0) {
	s_wsle(&io___2044);
	do_lio(&c__9, &c__1, "ERROR, DADER CALLED WITH CA VECTOR", 34L);
	e_wsle();
 
    }
    if (da_ .nomax == 1) {
	s_wsle(&io___2045);
	do_lio(&c__9, &c__1, "ERROR, DADER CALLED WITH NOMAX = 1", 34L);
	e_wsle();
 
    }

    dachk_(ina, &inoa, &inva, &c__0, &c_n1, &c_n1, inc, &inoc, &invc);

    ibase = da_ .nomax + 1;

    if (*idif > (da_ .nvmax + 1) / 2) {
	ider1 = 0;
	ider1s = 0;
	ider2 = *idif - (da_ .nvmax + 1) / 2;
	ider2s = 1;
	i__1 = ider2 - 1;
	for (jj = 1; jj <= i__1; ++jj) {
 
	    ider2s *= ibase;
	}
	xdivi = (doublereal) (ider2s * ibase);
    } else {
	ider1 = *idif;
	ider1s = 1;
	i__1 = ider1 - 1;
	for (jj = 1; jj <= i__1; ++jj) {
 
	    ider1s *= ibase;
	}
	ider2 = 0;
	ider2s = 0;
	xdivi = (doublereal) (ider1s * ibase);
    }

    ibase = da_ .nomax + 1;

    ic = ipoc - 1;

    i__1 = ipoa + illa - 1;
    for (i__ = ipoa; i__ <= i__1; ++i__) {

	if (ider1 == 0) {
	    iee = da_ .i2[i__ - 1];
	} else {
	    iee = da_ .i1[i__ - 1];
	}

	x = iee / xdivi;
	ifac = (integer) (ibase * (x - (integer) (x + da_ .epsmac) + 
		da_ .epsmac));

	if (ifac == 0) {
	    goto L100;
	}

	++ic;
	da_ .cc[ic - 1] = da_ .cc[i__ - 1] * ifac;
	da_ .i1[ic - 1] = da_ .i1[i__ - 1] - ider1s;
	da_ .i2[ic - 1] = da_ .i2[i__ - 1] - ider2s;

L100:
	;
    }

    da_ .idall[*inc - 1] = ic - ipoc + 1;
    if (da_ .idall[*inc - 1] > da_ .idalm[*inc - 1]) {
	s_wsle(&io___2058);
	do_lio(&c__9, &c__1, "ERROR IN DADER ", 15L);
	e_wsle();
 
    }

    return 0;
}  


 
  int dapoi_(ina, inb, inc, n)
integer *ina, *inb, *inc, *n;
{
     
    integer i__1, i__2;

     
    static integer i__, is[3];
    extern   int daadd_(), dadal_(), daall_(), dader_(), 
	    dacon_(), dacop_(), dasub_(), damul_();

 

 

 


 

 



    is[0] = 0;
    is[1] = 0;
    is[2] = 0;
    daall_(is, &c__3, "$$DAPOI $$", & da_ .nomax, & da_ .nvmax, 10L);

    dacon_(inc, &c_b251);

    i__1 = *n;
    for (i__ = 1; i__ <= i__1; ++i__) {

	i__2 = (i__ << 1) - 1;
	dader_(&i__2, ina, is);
	i__2 = i__ << 1;
	dader_(&i__2, inb, &is[1]);
	damul_(is, &is[1], &is[2]);
	daadd_(inc, &is[2], is);
	dacop_(is, inc);

	i__2 = i__ << 1;
	dader_(&i__2, ina, is);
	i__2 = (i__ << 1) - 1;
	dader_(&i__2, inb, &is[1]);
	damul_(is, &is[1], &is[2]);
	dasub_(inc, &is[2], is);
	dacop_(is, inc);

 
    }

    dadal_(is, &c__3);

    return 0;
}  

 
 
  int dacfu_(ina, fun, inc)
integer *ina;
  int (*fun) ();
integer *inc;
{
    static integer incc, illc, ilmc, inoc, ipoc, invc;
    extern   int dadal_(), daall_(), dainf_(), dacop_(), 
	    dacfut_();

 

 
 
 

 

 



    if (*ina == *inc) {
	dainf_(inc, &inoc, &invc, &ipoc, &ilmc, &illc);
	incc = 0;
	daall_(&incc, &c__1, "$$DAJUNK$$", &inoc, &invc, 10L);
	dacfut_(ina, fun, &incc);
	dacop_(&incc, inc);
	dadal_(&incc, &c__1);
    } else {
	dacfut_(ina, fun, inc);
    }
    return 0;
}  


 
  int dacfut_(ina, fun, inc)
integer *ina;
doublereal (*fun) ();
integer *inc;
{
     
    integer i__1;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer j[20], ia, ic;
    static doublereal cfac;
    static integer illa, ilma, illc, ilmc, inoa, ipoa, inoc, ipoc, inva, invc;
    extern   int dancd_(), dachk_(), dainf_();

     
    static cilist io___2077 = { 0, 6, 0, 0, 0 };
    static cilist io___2078 = { 0, 6, 0, 0, 0 };
    static cilist io___2083 = { 0, 6, 0, 0, 0 };


 

 
 
 

 

 



    dainf_(ina, &inoa, &inva, &ipoa, &ilma, &illa);
    dainf_(inc, &inoc, &invc, &ipoc, &ilmc, &illc);

    if (inva == 0 || invc == 0) {
	s_wsle(&io___2077);
	do_lio(&c__9, &c__1, "ERROR, DACFU CALLED WITH CA VECTOR", 34L);
	e_wsle();
 
    }
    if (da_ .nomax == 1) {
	s_wsle(&io___2078);
	do_lio(&c__9, &c__1, "ERROR, DACFU CALLED WITH NOMAX = 1", 34L);
	e_wsle();
 
    }

    dachk_(ina, &inoa, &inva, &c__0, &c_n1, &c_n1, inc, &inoc, &invc);

    ic = ipoc - 1;

    i__1 = ipoa + illa - 1;
    for (ia = ipoa; ia <= i__1; ++ia) {

	dancd_(& da_ .i1[ia - 1], & da_ .i2[ia - 1], j);
	cfac = (*fun)(j);
	if ((( cfac ) >= 0 ? ( cfac ) : -( cfac ))  < da_ .eps) {
	    goto L100;
	}

	++ic;
	da_ .cc[ic - 1] = da_ .cc[ia - 1] * cfac;
	da_ .i1[ic - 1] = da_ .i1[ia - 1];
	da_ .i2[ic - 1] = da_ .i2[ia - 1];

L100:
	;
    }

    da_ .idall[*inc - 1] = ic - ipoc + 1;
    if (da_ .idall[*inc - 1] > da_ .idalm[*inc - 1]) {
	s_wsle(&io___2083);
	do_lio(&c__9, &c__1, "ERROR IN DACFU ", 15L);
	e_wsle();
 
    }

    return 0;
}  


 
  int damuf_(fun)
doublereal (*fun) ();
{
     
    integer i__1;

     
    static integer j[20], ia;
    static doublereal cfac;
    extern   int dancd_();

 

 

 
 


 

 



    da_ .lfi = 1;

    i__1 = da_ .nmmax;
    for (ia = 1; ia <= i__1; ++ia) {

	dancd_(& da_ .i1[ia - 1], & da_ .i2[ia - 1], j);
	cfac = (*fun)(j);

	if ((( cfac ) >= 0 ? ( cfac ) : -( cfac ))  < da_ .eps) {
	    da_ .ifi[ia - 1] = 0;
	} else {
	    da_ .ifi[ia - 1] = 1;
	}

 
    }

    return 0;
}  

 
 
  int daimp_(h__, lh, ina)
doublereal *h__;
integer *lh, *ina;
{
     
    integer i__1;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer i__, illa, ilma, inoa, ipoa, inva;
    extern   int dapac_(), dainf_();

     
    static cilist io___2092 = { 0, 6, 0, 0, 0 };


 

 

 

 

 



     
    --h__;

     
    dainf_(ina, &inoa, &inva, &ipoa, &ilma, &illa);

    if (da_ .nmmax > *lh) {
	s_wsle(&io___2092);
	do_lio(&c__9, &c__1, "ERROR IN ROUTINE DAIMP, ILMA,LH = ", 34L);
	do_lio(&c__3, &c__1, (char *)&ilma, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)&(*lh), (ftnlen)sizeof(integer));
	e_wsle();
 
    }

    i__1 = da_ .nmmax;
    for (i__ = 1; i__ <= i__1; ++i__) {
 
	da_ .cc[i__ - 1] = h__[i__];
    }

    dapac_(ina, &c__1);

    return 0;
}  


 
  int daexp_(ina, h__, lh)
integer *ina;
doublereal *h__;
integer *lh;
{
     
    integer i__1;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer i__, illa, ilma, inoa, ipoa, inva;
    extern   int dainf_(), daunp_();

     
    static cilist io___2099 = { 0, 6, 0, 0, 0 };


 

 

 

 

 



     
    --h__;

     
    dainf_(ina, &inoa, &inva, &ipoa, &ilma, &illa);

    if (da_ .nmmax > *lh) {
	s_wsle(&io___2099);
	do_lio(&c__9, &c__1, "ERROR IN ROUTINE DAEXP, ILMA,LH = ", 34L);
	do_lio(&c__3, &c__1, (char *)&ilma, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)&(*lh), (ftnlen)sizeof(integer));
	e_wsle();
 
    }

    daunp_(ina);

    i__1 = da_ .nmmax;
    for (i__ = 1; i__ <= i__1; ++i__) {
 
	h__[i__] = da_ .cc[i__ - 1];
    }

    return 0;
}  

 

 
  int dapria_(ina, iunit)
integer *ina, *iunit;
{
     
    static char fmt_501[] = "(\002 \002,i3,1x,g24.17,1x,100(1x,i2))";

     
    integer i__1, i__2, i__3;
    doublereal d__1;

     
    integer s_wsle(), do_lio(), e_wsle();
      int s_stop(), s_copy();
    integer s_wsfe(), do_fio(), e_wsfe();

     
    static integer i__, j[20];
    static char c10[10], k10[10];
    static integer ii, ioa, illa, ilma, inoa, ipoa, inva, isum, iout;
    extern   int dancd_();

     
    static cilist io___2101 = { 0, 6, 0, 0, 0 };
    static cilist io___2115 = { 0, 0, 0, fmt_501, 0 };


 

 
 

 

 

 

 



    if (*ina < 1 || *ina > da_ .nda) {
	s_wsle(&io___2101);
	do_lio(&c__9, &c__1, "ERROR IN DAPRI, INA = ", 22L);
	do_lio(&c__3, &c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	e_wsle();
	s_stop("", 0L);
    }

    inoa = da_ .idano[*ina - 1];
    inva = da_ .idanv[*ina - 1];
    ipoa = da_ .idapo[*ina - 1];
    ilma = da_ .idalm[*ina - 1];
    illa = da_ .idall[*ina - 1];

 
 

 


 
 
 

    s_copy(c10, "      NO =", 10L, 10L);
    s_copy(k10, "      NV =", 10L, 10L);
 
    iout = 0;

    i__1 = inoa;
    for (ioa = 0; ioa <= i__1; ++ioa) {
	i__2 = ipoa + illa - 1;
	for (ii = ipoa; ii <= i__2; ++ii) {
	    if (da_ .ieo[da_ .ia1[da_ .i1[ii - 1]] + da_ .ia2[da_ .i2[ii - 1]]
		     - 1] != ioa) {
		goto L100;
	    }

 
	    if ((d__1 = da_ .cc[ii - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > da_ .eps) {
 
		++iout;
		dancd_(& da_ .i1[ii - 1], & da_ .i2[ii - 1], j);

 
		isum = 0;
		for (i__ = 6; i__ <= 13; ++i__) {
		    isum += j[i__ - 1];
 
		}
 
		if (j[0] != 0) {
		    goto L591;
		}
		if (j[1] != 0) {
		    goto L591;
		}
		if (j[2] != 0) {
		    goto L591;
		}
		if (j[3] != 0) {
		    goto L591;
		}
		if (j[4] == 0) {
		    goto L591;
		}
		io___2115.ciunit = *iunit;
		s_wsfe(&io___2115);
		do_fio(&c__1, (char *)&ioa, (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)& da_ .cc[ii - 1], (ftnlen)sizeof(
			doublereal));
		i__3 = inva;
		for (i__ = 1; i__ <= i__3; ++i__) {
		    do_fio(&c__1, (char *)&j[i__ - 1], (ftnlen)sizeof(integer)
			    );
		}
		e_wsfe();
 
L591:
		;
	    }
 

L100:
	    ;
	}
    }

    for (i__ = 1; i__ <= 20; ++i__) {
 
	j[i__ - 1] = 0;
    }
    if (iout == 0) {
	iout = 1;
    }
 

    return 0;
}  


 
  int dapri_(ina, iunit)
integer *ina, *iunit;
{
     
    integer i__1, i__2, i__3;
    doublereal d__1;

     
    integer s_wsle(), do_lio(), e_wsle();
      int s_stop();
    integer s_wsfe(), do_fio(), e_wsfe();

     
    static integer i__, j[20], ii, ioa, iii, illa, ilma, inoa, ipoa, inva, 
	    iout;
    extern   int dancd_();

     
    static cilist io___2116 = { 0, 6, 0, 0, 0 };
    static cilist io___2122 = { 0, 0, 0, "(/1X,A,A,I5,A,I5,A,I5/1X,A/)", 0 };
    static cilist io___2123 = { 0, 0, 0, "(A)", 0 };
    static cilist io___2125 = { 0, 0, 0, "(I6,2X,G20.14)", 0 };
    static cilist io___2126 = { 0, 0, 0, "(A)", 0 };
    static cilist io___2127 = { 0, 0, 0, "(6X,2X,G20.14,I5)", 0 };
    static cilist io___2128 = { 0, 0, 0, "(A)", 0 };
    static cilist io___2129 = { 0, 0, 0, "(A)", 0 };
    static cilist io___2134 = { 0, 0, 0, "(I6,2X,G20.14,I5,4X,18(2I2,1X))", 0 
	    };
    static cilist io___2136 = { 0, 0, 0, 0, 0 };
    static cilist io___2137 = { 0, 0, 0, "(A)", 0 };


 

 

 

 

 



    if (*ina < 1 || *ina > da_ .nda) {
	s_wsle(&io___2116);
	do_lio(&c__9, &c__1, "ERROR IN DAPRI, INA = ", 22L);
	do_lio(&c__3, &c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	e_wsle();
 
 
	s_stop("", 0L);
    }

    inoa = da_ .idano[*ina - 1];
    inva = da_ .idanv[*ina - 1];
    ipoa = da_ .idapo[*ina - 1];
    ilma = da_ .idalm[*ina - 1];
    illa = da_ .idall[*ina - 1];

    io___2122.ciunit = *iunit;
    s_wsfe(&io___2122);
    do_fio(&c__1, daname_ .daname + (*ina - 1) * 10, 10L);
    do_fio(&c__1, ", NO =", 6L);
    do_fio(&c__1, (char *)&inoa, (ftnlen)sizeof(integer));
    do_fio(&c__1, ", NV =", 6L);
    do_fio(&c__1, (char *)&inva, (ftnlen)sizeof(integer));
    do_fio(&c__1, ", INA =", 7L);
    do_fio(&c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
    do_fio(&c__1, "*********************************************", 45L);
    e_wsfe();

    if (inva == 0) {
	io___2123.ciunit = *iunit;
	s_wsfe(&io___2123);
	do_fio(&c__1, "    I  VALUE  ", 14L);
	e_wsfe();
	i__1 = ipoa + illa - 1;
	for (i__ = ipoa; i__ <= i__1; ++i__) {
 
	    io___2125.ciunit = *iunit;
	    s_wsfe(&io___2125);
	    i__2 = i__ - ipoa;
	    do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)& da_ .cc[i__ - 1], (ftnlen)sizeof(
		    doublereal));
	    e_wsfe();
	}
    } else if (da_ .nomax == 1) {
	io___2126.ciunit = *iunit;
	s_wsfe(&io___2126);
	do_fio(&c__1, "       COEFFICIENT          VARIABLE", 36L);
	e_wsfe();
	i__2 = illa;
	for (i__ = 1; i__ <= i__2; ++i__) {
 
	    io___2127.ciunit = *iunit;
	    s_wsfe(&io___2127);
	    do_fio(&c__1, (char *)& da_ .cc[ipoa + i__ - 2], (ftnlen)sizeof(
		    doublereal));
	    i__1 = i__ - 1;
	    do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer));
	    e_wsfe();
	}
    } else {
	if (illa != 0) {
	    io___2128.ciunit = *iunit;
	    s_wsfe(&io___2128);
	    do_fio(&c__1, "    I  COEFFICIENT          ORDER   EXPONENTS", 
		    45L);
	    e_wsfe();
	}
	if (illa == 0) {
	    io___2129.ciunit = *iunit;
	    s_wsfe(&io___2129);
	    do_fio(&c__1, "   ALL COMPONENTS ZERO ", 23L);
	    e_wsfe();
	}
	iout = 0;
	i__1 = inoa;
	for (ioa = 0; ioa <= i__1; ++ioa) {
	    i__2 = ipoa + illa - 1;
	    for (ii = ipoa; ii <= i__2; ++ii) {
		if (da_ .ieo[da_ .ia1[da_ .i1[ii - 1]] + da_ .ia2[da_ .i2[ii 
			- 1]] - 1] != ioa) {
		    goto L100;
		}
		dancd_(& da_ .i1[ii - 1], & da_ .i2[ii - 1], j);
 
		if ((d__1 = da_ .cc[ii - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > da_ .eps) {
 
		    ++iout;
		    io___2134.ciunit = *iunit;
		    s_wsfe(&io___2134);
		    do_fio(&c__1, (char *)&iout, (ftnlen)sizeof(integer));
		    do_fio(&c__1, (char *)& da_ .cc[ii - 1], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)&ioa, (ftnlen)sizeof(integer));
		    i__3 = da_ .nvmax;
		    for (iii = 1; iii <= i__3; ++iii) {
			do_fio(&c__1, (char *)&j[iii - 1], (ftnlen)sizeof(
				integer));
		    }
		    e_wsfe();
 
		    io___2136.ciunit = *iunit;
		    s_wsle(&io___2136);
		    do_lio(&c__5, &c__1, (char *)& da_ .cc[ii - 1], (ftnlen)
			    sizeof(doublereal));
		    e_wsle();
		}
 

L100:
		;
	    }
	}

    }
    io___2137.ciunit = *iunit;
    s_wsfe(&io___2137);
    do_fio(&c__1, "                                      ", 38L);
    e_wsfe();

    return 0;
}  

 
 
  int daprimax_(ina, iunit)
integer *ina, *iunit;
{
     
    integer i__1, i__2, i__3;
    doublereal d__1;

     
    integer s_wsle(), do_lio(), e_wsle();
      int s_stop();
    integer s_wsfe(), do_fio(), e_wsfe();

     
    static integer i__, j[20], ii, ioa, iii, illa, ilma, inoa, ipoa, inva, 
	    iout;
    extern   int dancd_();

     
    static cilist io___2138 = { 0, 6, 0, 0, 0 };
    static cilist io___2145 = { 0, 0, 0, "(I6,2X,G20.14)", 0 };
    static cilist io___2146 = { 0, 0, 0, "(6X,2X,G20.14,I5)", 0 };
    static cilist io___2151 = { 0, 0, 0, "(I6,2X,G20.14,I5,4X,18(2I2,1X))", 0 
	    };
    static cilist io___2153 = { 0, 0, 0, 0, 0 };


 

 

 

 

 



    if (*ina < 1 || *ina > da_ .nda) {
	s_wsle(&io___2138);
	do_lio(&c__9, &c__1, "ERROR IN DAPRI, INA = ", 22L);
	do_lio(&c__3, &c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	e_wsle();
	s_stop("", 0L);
    }

    inoa = da_ .idano[*ina - 1];
    inva = da_ .idanv[*ina - 1];
    ipoa = da_ .idapo[*ina - 1];
    ilma = da_ .idalm[*ina - 1];
    illa = da_ .idall[*ina - 1];

 
 

 


    if (inva == 0) {
 
 
	i__1 = ipoa + illa - 1;
	for (i__ = ipoa; i__ <= i__1; ++i__) {
 
	    io___2145.ciunit = *iunit;
	    s_wsfe(&io___2145);
	    i__2 = i__ - ipoa;
	    do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)& da_ .cc[i__ - 1], (ftnlen)sizeof(
		    doublereal));
	    e_wsfe();
	}
    } else if (da_ .nomax == 1) {
 
 
	i__2 = illa;
	for (i__ = 1; i__ <= i__2; ++i__) {
 
	    io___2146.ciunit = *iunit;
	    s_wsfe(&io___2146);
	    do_fio(&c__1, (char *)& da_ .cc[ipoa + i__ - 2], (ftnlen)sizeof(
		    doublereal));
	    i__1 = i__ - 1;
	    do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer));
	    e_wsfe();
	}
    } else {
 
 
 

	iout = 0;
	i__1 = inoa;
	for (ioa = 0; ioa <= i__1; ++ioa) {
	    i__2 = ipoa + illa - 1;
	    for (ii = ipoa; ii <= i__2; ++ii) {
		if (da_ .ieo[da_ .ia1[da_ .i1[ii - 1]] + da_ .ia2[da_ .i2[ii 
			- 1]] - 1] != ioa) {
		    goto L100;
		}
		dancd_(& da_ .i1[ii - 1], & da_ .i2[ii - 1], j);
 
		if ((d__1 = da_ .cc[ii - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > da_ .eps) {
 
		    ++iout;
		    io___2151.ciunit = *iunit;
		    s_wsfe(&io___2151);
		    do_fio(&c__1, (char *)&iout, (ftnlen)sizeof(integer));
		    do_fio(&c__1, (char *)& da_ .cc[ii - 1], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)&ioa, (ftnlen)sizeof(integer));
		    i__3 = da_ .nvmax;
		    for (iii = 1; iii <= i__3; ++iii) {
			do_fio(&c__1, (char *)&j[iii - 1], (ftnlen)sizeof(
				integer));
		    }
		    e_wsfe();
 
		    io___2153.ciunit = *iunit;
		    s_wsle(&io___2153);
		    do_lio(&c__5, &c__1, (char *)& da_ .cc[ii - 1], (ftnlen)
			    sizeof(doublereal));
		    e_wsle();
		}
 

L100:
		;
	    }
	}

    }
 

    return 0;
}  

 
 
  int darea_(ina, iunit)
integer *ina, *iunit;
{
     
    integer i__1, i__2;

     
    integer s_wsle(), do_lio(), e_wsle();
      int s_stop();
    integer s_rsfe(), do_fio(), e_rsfe(), s_cmp(), s_rsle(), e_rsle();

     
    static doublereal c__;
    static integer i__, j[20];
    static char c10[10];
    static integer ic, ii, io, ii1, ii2, io1, iin, nno, illa, ilma, inoa, 
	    ipoa, inva;
    extern   int dadcd_(), dapac_(), daclr_();
    static integer iwarin, iwarno, iwarnv;

     
    static cilist io___2154 = { 0, 6, 0, 0, 0 };
    static cilist io___2166 = { 0, 0, 0, "(A10)", 0 };
    static cilist io___2168 = { 0, 0, 0, "(18X,I4)", 0 };
    static cilist io___2170 = { 0, 0, 0, "(A10)", 0 };
    static cilist io___2171 = { 0, 0, 0, "(A10)", 0 };
    static cilist io___2172 = { 0, 0, 0, "(A10)", 0 };
    static cilist io___2173 = { 1, 0, 0, "(6X,2X,G20.14,I5)", 0 };
    static cilist io___2175 = { 0, 0, 0, "(A10)", 0 };
    static cilist io___2176 = { 0, 6, 0, 0, 0 };
    static cilist io___2178 = { 0, 0, 0, "(I6,2X,G20.14,I5,4X,18(2I2,1X))", 0 
	    };
    static cilist io___2181 = { 0, 0, 0, 0, 0 };
    static cilist io___2182 = { 0, 6, 0, 0, 0 };
    static cilist io___2184 = { 0, 6, 0, 0, 0 };


 

 

 

 

 



    if (*ina < 1 || *ina > da_ .nda) {
	s_wsle(&io___2154);
	do_lio(&c__9, &c__1, "ERROR IN DAREA, INA = ", 22L);
	do_lio(&c__3, &c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	e_wsle();
 
 
	s_stop("", 0L);
    }

    inoa = da_ .idano[*ina - 1];
    inva = da_ .idanv[*ina - 1];
    ipoa = da_ .idapo[*ina - 1];
    ilma = da_ .idalm[*ina - 1];
    illa = da_ .idall[*ina - 1];

    for (i__ = 1; i__ <= 20; ++i__) {
 
	j[i__ - 1] = 0;
    }

    daclr_(&c__1);

    ic = 0;

    iwarno = 0;
    iwarnv = 0;
    iwarin = 0;

    io___2166.ciunit = *iunit;
    s_rsfe(&io___2166);
    do_fio(&c__1, c10, 10L);
    e_rsfe();
    io___2168.ciunit = *iunit;
    s_rsfe(&io___2168);
    do_fio(&c__1, (char *)&nno, (ftnlen)sizeof(integer));
    e_rsfe();
    io___2170.ciunit = *iunit;
    s_rsfe(&io___2170);
    do_fio(&c__1, c10, 10L);
    e_rsfe();
    io___2171.ciunit = *iunit;
    s_rsfe(&io___2171);
    do_fio(&c__1, c10, 10L);
    e_rsfe();
    io___2172.ciunit = *iunit;
    s_rsfe(&io___2172);
    do_fio(&c__1, c10, 10L);
    e_rsfe();

    if (nno == 1) {
	i__1 = illa;
	for (i__ = 1; i__ <= i__1; ++i__) {
	    io___2173.ciunit = *iunit;
	    i__2 = s_rsfe(&io___2173);
	    if (i__2 != 0) {
		goto L95;
	    }
	    i__2 = do_fio(&c__1, (char *)& da_ .cc[ipoa + i__ - 2], (ftnlen)
		    sizeof(doublereal));
	    if (i__2 != 0) {
		goto L95;
	    }
	    i__2 = do_fio(&c__1, (char *)&ii, (ftnlen)sizeof(integer));
	    if (i__2 != 0) {
		goto L95;
	    }
	    i__2 = e_rsfe();
	    if (i__2 != 0) {
		goto L95;
	    }
	    if (ii != i__ - 1) {
		goto L95;
	    }
 
	}
	io___2175.ciunit = *iunit;
	s_rsfe(&io___2175);
	do_fio(&c__1, c10, 10L);
	e_rsfe();
	if (s_cmp(c10, "          ", 10L, 10L) != 0) {
	    goto L95;
	}
	return 0;
L95:
	s_wsle(&io___2176);
	do_lio(&c__9, &c__1, "ERROR IN DAREA, VECTOR COULD NOT BE READ", 40L);
	e_wsle();
	s_stop("", 0L);
    }

    iin = 0;

L10:
    ++iin;
    io___2178.ciunit = *iunit;
    s_rsfe(&io___2178);
    do_fio(&c__1, (char *)&ii, (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)&c__, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)&io, (ftnlen)sizeof(integer));
    i__1 = inva;
    for (i__ = 1; i__ <= i__1; ++i__) {
	do_fio(&c__1, (char *)&j[i__ - 1], (ftnlen)sizeof(integer));
    }
    e_rsfe();

    if (ii == 0) {
	goto L20;
    }
 
    io___2181.ciunit = *iunit;
    s_rsle(&io___2181);
    do_lio(&c__5, &c__1, (char *)&c__, (ftnlen)sizeof(doublereal));
    e_rsle();
 
    if (ii != iin) {
	if (iwarin == 0) {
	    s_wsle(&io___2182);
	    do_lio(&c__9, &c__1, "WARNING IN DAREA, FILE ", 23L);
	    do_lio(&c__9, &c__1, "NUMBERING OUT OF ORDER ", 23L);
	    e_wsle();
	}
	iwarin = 1;
    }
    io1 = 0;
    i__1 = inva;
    for (i__ = 1; i__ <= i__1; ++i__) {
 
	io1 += j[i__ - 1];
    }

    if (io1 != io) {
	if (iwarnv == 0) {
	    s_wsle(&io___2184);
	    do_lio(&c__9, &c__1, "WARNING IN DAREA, FILE ", 23L);
	    do_lio(&c__9, &c__1, "CONTAINS MORE VARIABLES THAN VECTOR", 35L);
	    e_wsle();
	}
	iwarnv = 1;
	goto L10;
    }
    if (io > inoa) {
 
 
	iwarno = 1;
	goto L10;
    }

    ++ic;
    dadcd_(j, &ii1, &ii2);
    ic = da_ .ia1[ii1] + da_ .ia2[ii2];
    da_ .cc[ic - 1] = c__;
    goto L10;

L20:

    dapac_(ina, &c__1);

    return 0;
}  

 

 
  int dareab_(ina, iunit)
integer *ina, *iunit;
{
     
    integer i__1, i__2;

     
    integer s_wsle(), do_lio(), e_wsle();
      int s_stop();
    integer s_rsfe(), do_fio(), e_rsfe(), s_cmp(), s_rsle(), e_rsle();

     
    static doublereal c__;
    static integer i__, j[20];
    static doublereal x;
    static char c10[10];
    static integer ic, ii, io, ii1, ii2, io1, iin, nno, illa, ilma, inoa, 
	    ipoa, inva;
    extern   int dadcd_(), dapac_(), daclr_();
    static integer iwarin, iwarno, iwarnv;

     
    static cilist io___2187 = { 0, 6, 0, 0, 0 };
    static cilist io___2189 = { 0, 6, 0, 0, 0 };
    static cilist io___2201 = { 0, 0, 0, "(A10)", 0 };
    static cilist io___2203 = { 0, 0, 0, "(18X,I4)", 0 };
    static cilist io___2205 = { 0, 0, 0, "(A10)", 0 };
    static cilist io___2206 = { 0, 0, 0, "(A10)", 0 };
    static cilist io___2207 = { 0, 0, 0, "(A10)", 0 };
    static cilist io___2208 = { 1, 0, 0, "(6X,2X,G20.14,I5)", 0 };
    static cilist io___2210 = { 0, 0, 0, "(A10)", 0 };
    static cilist io___2211 = { 0, 6, 0, 0, 0 };
    static cilist io___2213 = { 0, 0, 0, "(I6,2X,G20.14,I5,4X,18(2I2,1X))", 0 
	    };
    static cilist io___2216 = { 0, 0, 0, 0, 0 };
    static cilist io___2217 = { 0, 6, 0, 0, 0 };
    static cilist io___2219 = { 0, 6, 0, 0, 0 };
    static cilist io___2220 = { 0, 6, 0, 0, 0 };


 

 

 

 

 



    if (*ina < 1 || *ina > da_ .nda) {
	s_wsle(&io___2187);
	do_lio(&c__9, &c__1, "ERROR IN DAPRI, INA = ", 22L);
	do_lio(&c__3, &c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	e_wsle();
	x = (float)0.;
 
	s_wsle(&io___2189);
	do_lio(&c__5, &c__1, (char *)&x, (ftnlen)sizeof(doublereal));
	e_wsle();
	s_stop("", 0L);
    }

    inoa = da_ .idano[*ina - 1];
    inva = da_ .idanv[*ina - 1];
    ipoa = da_ .idapo[*ina - 1];
    ilma = da_ .idalm[*ina - 1];
    illa = da_ .idall[*ina - 1];

    for (i__ = 1; i__ <= 20; ++i__) {
 
	j[i__ - 1] = 0;
    }

    daclr_(&c__1);

    ic = 0;

    iwarno = 0;
    iwarnv = 0;
    iwarin = 0;

    io___2201.ciunit = *iunit;
    s_rsfe(&io___2201);
    do_fio(&c__1, c10, 10L);
    e_rsfe();
    io___2203.ciunit = *iunit;
    s_rsfe(&io___2203);
    do_fio(&c__1, (char *)&nno, (ftnlen)sizeof(integer));
    e_rsfe();
    io___2205.ciunit = *iunit;
    s_rsfe(&io___2205);
    do_fio(&c__1, c10, 10L);
    e_rsfe();
    io___2206.ciunit = *iunit;
    s_rsfe(&io___2206);
    do_fio(&c__1, c10, 10L);
    e_rsfe();
    io___2207.ciunit = *iunit;
    s_rsfe(&io___2207);
    do_fio(&c__1, c10, 10L);
    e_rsfe();

    if (nno == 1) {
	i__1 = illa;
	for (i__ = 1; i__ <= i__1; ++i__) {
	    io___2208.ciunit = *iunit;
	    i__2 = s_rsfe(&io___2208);
	    if (i__2 != 0) {
		goto L95;
	    }
	    i__2 = do_fio(&c__1, (char *)& da_ .cc[ipoa + i__ - 2], (ftnlen)
		    sizeof(doublereal));
	    if (i__2 != 0) {
		goto L95;
	    }
	    i__2 = do_fio(&c__1, (char *)&ii, (ftnlen)sizeof(integer));
	    if (i__2 != 0) {
		goto L95;
	    }
	    i__2 = e_rsfe();
	    if (i__2 != 0) {
		goto L95;
	    }
	    if (ii != i__ - 1) {
		goto L95;
	    }
 
	}
	io___2210.ciunit = *iunit;
	s_rsfe(&io___2210);
	do_fio(&c__1, c10, 10L);
	e_rsfe();
	if (s_cmp(c10, "          ", 10L, 10L) != 0) {
	    goto L95;
	}
	return 0;
L95:
	s_wsle(&io___2211);
	do_lio(&c__9, &c__1, "ERROR IN DAREA, VECTOR COULD NOT BE READ", 40L);
	e_wsle();
	s_stop("", 0L);
    }

    iin = 0;

L10:
    ++iin;
    io___2213.ciunit = *iunit;
    s_rsfe(&io___2213);
    do_fio(&c__1, (char *)&ii, (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)&c__, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)&io, (ftnlen)sizeof(integer));
    i__1 = inva;
    for (i__ = 1; i__ <= i__1; ++i__) {
	do_fio(&c__1, (char *)&j[i__ - 1], (ftnlen)sizeof(integer));
    }
    e_rsfe();

    if (ii == 0) {
	goto L20;
    }
 
    io___2216.ciunit = *iunit;
    s_rsle(&io___2216);
    do_lio(&c__5, &c__1, (char *)&c__, (ftnlen)sizeof(doublereal));
    e_rsle();
 
    if (ii != iin) {
	if (iwarin == 0) {
	    s_wsle(&io___2217);
	    do_lio(&c__9, &c__1, "WARNING IN DAREA, FILE ", 23L);
	    do_lio(&c__9, &c__1, "NUMBERING OUT OF ORDER ", 23L);
	    e_wsle();
	}
	iwarin = 1;
    }
    io1 = 0;
    i__1 = inva;
    for (i__ = 1; i__ <= i__1; ++i__) {
 
	io1 += j[i__ - 1];
    }

    if (io1 != io) {
	if (iwarnv == 0) {
	    s_wsle(&io___2219);
	    do_lio(&c__9, &c__1, "WARNING IN DAREA, FILE ", 23L);
	    do_lio(&c__9, &c__1, "CONTAINS MORE VARIABLES THAN VECTOR", 35L);
	    e_wsle();
	}
	iwarnv = 1;
	goto L10;
    }
    if (io > inoa) {
	if (iwarno == 0) {
	    s_wsle(&io___2220);
	    do_lio(&c__9, &c__1, "WARNING IN DAREA, FILE ", 23L);
	    do_lio(&c__9, &c__1, "CONTAINS HIGHER ORDERS THAN VECTOR ", 35L);
	    e_wsle();
	}
	iwarno = 1;
	goto L10;
    }

    ++ic;
    dadcd_(j, &ii1, &ii2);
    ic = da_ .ia1[ii1] + da_ .ia2[ii2];
    da_ .cc[ic - 1] = c__;
    goto L10;

L20:

    dapac_(ina, &c__1);

    return 0;
}  


 
  int dadeb_(iunit, c__, istop, c_len)
integer *iunit;
char *c__;
integer *istop;
ftnlen c_len;
{
     
    address a__1[2];
    integer i__1[2], i__2;
    char ch__1[64];

     
    integer s_wsfe();
      int s_cat();
    integer do_fio(), e_wsfe(), s_wsle(), do_lio(), e_wsle();

     
    static integer i__;
    extern   int dapri_();

     
    static cilist io___2223 = { 0, 0, 0, "(///A/1X,79('*')/)", 0 };
    static cilist io___2224 = { 0, 0, 0, "(4(A,I7)/)", 0 };
    static cilist io___2225 = { 0, 0, 0, "(A/)", 0 };
    static cilist io___2227 = { 0, 0, 0, "(1X,A10,6I6)", 0 };
    static cilist io___2228 = { 0, 0, 0, "(/)", 0 };
    static cilist io___2229 = { 0, 0, 0, "(/1X,79('*')/)", 0 };
    static cilist io___2230 = { 0, 6, 0, 0, 0 };
    static cilist io___2231 = { 0, 6, 0, 0, 0 };
    static cilist io___2232 = { 0, 6, 0, 0, 0 };


 

 
 

 


 

 

 



 
    if ((0) ) {
 
	if (*iunit == 31) {
	}

	io___2223.ciunit = *iunit;
	s_wsfe(&io___2223);
 
	i__1[0] = 54, a__1[0] = " DIFFERENTIAL ALGEBRA DEBUGGING UTILITY, IDENTIFIER = ";
	i__1[1] = 10, a__1[1] = c__;
	s_cat(ch__1, a__1, i__1, &c__2, 64L);
	do_fio(&c__1, ch__1, 64L);
	e_wsfe();

	io___2224.ciunit = *iunit;
	s_wsfe(&io___2224);
	do_fio(&c__1, " NOMAX = ", 9L);
	do_fio(&c__1, (char *)& da_ .nomax, (ftnlen)sizeof(integer));
	do_fio(&c__1, ", NVMAX = ", 10L);
	do_fio(&c__1, (char *)& da_ .nvmax, (ftnlen)sizeof(integer));
	do_fio(&c__1, ", NMMAX = ", 10L);
	do_fio(&c__1, (char *)& da_ .nmmax, (ftnlen)sizeof(integer));
	do_fio(&c__1, ", NOCUT = ", 10L);
	do_fio(&c__1, (char *)& da_ .nocut, (ftnlen)sizeof(integer));
	e_wsfe();

	io___2225.ciunit = *iunit;
	s_wsfe(&io___2225);
	do_fio(&c__1, " NAME        IDANO IDANV IDAPO IDALM IDALL  ", 44L);
	e_wsfe();
	i__2 = da_ .nda;
	for (i__ = 1; i__ <= i__2; ++i__) {
	    io___2227.ciunit = *iunit;
	    s_wsfe(&io___2227);
	    do_fio(&c__1, daname_ .daname + (i__ - 1) * 10, 10L);
	    do_fio(&c__1, (char *)& da_ .idano[i__ - 1], (ftnlen)sizeof(
		    integer));
	    do_fio(&c__1, (char *)& da_ .idanv[i__ - 1], (ftnlen)sizeof(
		    integer));
	    do_fio(&c__1, (char *)& da_ .idapo[i__ - 1], (ftnlen)sizeof(
		    integer));
	    do_fio(&c__1, (char *)& da_ .idalm[i__ - 1], (ftnlen)sizeof(
		    integer));
	    do_fio(&c__1, (char *)& da_ .idall[i__ - 1], (ftnlen)sizeof(
		    integer));
	    e_wsfe();
 
	}

	io___2228.ciunit = *iunit;
	s_wsfe(&io___2228);
	e_wsfe();

	i__2 = da_ .nda;
	for (i__ = 1; i__ <= i__2; ++i__) {
	    dapri_(&i__, iunit);
 
	}

	io___2229.ciunit = *iunit;
	s_wsfe(&io___2229);
	e_wsfe();

	if (*istop == 0) {
	    return 0;
	}

 

 


	s_wsle(&io___2230);
	do_lio(&c__9, &c__1, "  ", 2L);
	e_wsle();
	s_wsle(&io___2231);
	do_lio(&c__9, &c__1, "*** ENVOKING SYSTEM ERROR EXIT ", 31L);
	e_wsle();
	s_wsle(&io___2232);
	do_lio(&c__9, &c__1, "  ", 2L);
	e_wsle();
 

    }
    return 0;
}  

 
 
  int daran_(ina, cm)
integer *ina;
doublereal *cm;
{
     

    static integer iran = 1234321;

     
    integer i__1;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer i__, illa, ilma, inoa, ipoa, inva;
    extern   int dapac_(), dainf_(), daclr_();
    extern doublereal dabran_();

     
    static cilist io___2240 = { 0, 6, 0, 0, 0 };
    static cilist io___2241 = { 0, 6, 0, 0, 0 };


 

 
 
 
 

 

 



    dainf_(ina, &inoa, &inva, &ipoa, &ilma, &illa);

    if (inva == 0 || da_ .nomax == 1) {
	i__1 = ipoa + ilma - 1;
	for (i__ = ipoa; i__ <= i__1; ++i__) {
	    if (*cm > 0.) {
		da_ .cc[i__ - 1] = dabran_(&iran);
		if (da_ .cc[i__ - 1] > *cm) {
		    da_ .cc[i__ - 1] = 0.;
		}
	    } else if (*cm < 0.) {
		da_ .cc[i__ - 1] = (doublereal) ((integer) (dabran_(&iran) * 
			10 + 1));
		if (da_ .cc[i__ - 1] > *cm * -10.) {
		    da_ .cc[i__ - 1] = 0.;
		}
	    }
 
	}
	da_ .idall[*ina - 1] = da_ .idalm[*ina - 1];
	return 0;
    }

    if (inoa != da_ .nomax || inva != da_ .nvmax) {
	s_wsle(&io___2240);
	do_lio(&c__9, &c__1, "ERROR IN DARAN, ONLY VECTORS WITH NO = NOMAX AND NV = NVMAX ALLOWED", 67L);
	e_wsle();
 
    }

    daclr_(&c__1);

    i__1 = da_ .nmmax;
    for (i__ = 1; i__ <= i__1; ++i__) {
	if (*cm > 0.) {
	    da_ .cc[i__ - 1] = dabran_(&iran);
	    if (da_ .cc[i__ - 1] > *cm) {
		da_ .cc[i__ - 1] = 0.;
	    }
	} else if (*cm < 0.) {
	    da_ .cc[i__ - 1] = (doublereal) ((integer) (dabran_(&iran) * 10 + 
		    1));
	    if (da_ .cc[i__ - 1] > *cm * -10.) {
		da_ .cc[i__ - 1] = 0.;
	    }
	} else {
	    s_wsle(&io___2241);
	    do_lio(&c__9, &c__1, "ERROR IN ROUTINE DARAN", 22L);
	    e_wsle();
 
	}
 
    }

    dapac_(ina, &c__1);

    return 0;
}  


 
doublereal dabran_(iran)
integer *iran;
{
     

    static doublereal xran = .234;

     
    doublereal ret_val, d__1;

     
    double sin();

 

 




    xran += 10.;
    if (xran > 1e4) {
	xran += (float)-9999.12345;
    }
    ret_val = (d__1 = sin(xran), (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
    ret_val *= 10;
    ret_val -= (integer) ret_val;
    if (ret_val < .1) {
	ret_val += .1;
    }

    return ret_val;
}  


 
 
  int danum_(no, nv, numda)
integer *no, *nv, *numda;
{
     
    integer i__1;

     
    static integer i__, mm;

 

 
 


    *numda = 1;
    mm = (( *nv ) >= ( *no ) ? ( *nv ) : ( *no )) ;

    i__1 = (( *nv ) <= ( *no ) ? ( *nv ) : ( *no )) ;
    for (i__ = 1; i__ <= i__1; ++i__) {
 
	*numda = *numda * (mm + i__) / i__;
    }

    return 0;
}  

 
 
  int dainf_(inc, inoc, invc, ipoc, ilmc, illc)
integer *inc, *inoc, *invc, *ipoc, *ilmc, *illc;
{
     
    integer s_wsle(), do_lio(), e_wsle();

     
    static cilist io___2246 = { 0, 6, 0, 0, 0 };


 

 
 

 

 


    if (*inc >= 1 && *inc <= da_ .nda) {
	*inoc = da_ .idano[*inc - 1];
	*invc = da_ .idanv[*inc - 1];
	*ipoc = da_ .idapo[*inc - 1];
	*ilmc = da_ .idalm[*inc - 1];
	*illc = da_ .idall[*inc - 1];
	return 0;
    }

    s_wsle(&io___2246);
    do_lio(&c__9, &c__1, "ERROR IN DAINF, DA VECTOR ", 26L);
    do_lio(&c__3, &c__1, (char *)&(*inc), (ftnlen)sizeof(integer));
    do_lio(&c__9, &c__1, " NOT FOUND ", 11L);
    e_wsle();
 

    return 0;
}  

 
 
  int dapac_(inc, lf)
integer *inc, *lf;
{
     
    integer i__1;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer i__, ic;
    static doublereal ccc;
    static integer illc, ilmc, inoc, ipoc, invc;
    extern   int dainf_();

     
    static cilist io___2255 = { 0, 6, 0, 0, 0 };


 

 
 
 
 

 

 


    dainf_(inc, &inoc, &invc, &ipoc, &ilmc, &illc);

    ic = ipoc - 1;

    if (da_ .lfi == 0 || *lf == 0) {
	i__1 = da_ .nmmax;
	for (i__ = 1; i__ <= i__1; ++i__) {
	    ccc = da_ .cc[i__ - 1];
	    if ((( ccc ) >= 0 ? ( ccc ) : -( ccc ))  < da_ .eps) {
		goto L100;
	    }
	    ++ic;
	    da_ .cc[ic - 1] = ccc;
	    da_ .i1[ic - 1] = da_ .ie1[i__ - 1];
	    da_ .i2[ic - 1] = da_ .ie2[i__ - 1];
L100:
	    ;
	}
    } else {
	i__1 = da_ .nmmax;
	for (i__ = 1; i__ <= i__1; ++i__) {
	    ccc = da_ .cc[i__ - 1];
	    if (da_ .ifi[i__ - 1] == 0) {
		goto L200;
	    }
	    if ((( ccc ) >= 0 ? ( ccc ) : -( ccc ))  < da_ .eps) {
		goto L200;
	    }
	    ++ic;
	    da_ .cc[ic - 1] = ccc;
	    da_ .i1[ic - 1] = da_ .ie1[i__ - 1];
	    da_ .i2[ic - 1] = da_ .ie2[i__ - 1];
L200:
	    ;
	}
    }

    da_ .idall[*inc - 1] = ic - ipoc + 1;
    if (da_ .idall[*inc - 1] > da_ .idalm[*inc - 1]) {
	s_wsle(&io___2255);
	do_lio(&c__9, &c__1, "ERROR IN DAPAC ", 15L);
	e_wsle();
 
    }

    return 0;
}  

 
 
  int daunp_(inc)
integer *inc;
{
     
    integer i__1;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer i__, ic, illc, ilmc, inoc, ipoc, invc;
    extern   int dainf_(), daclr_();

     
    static cilist io___2262 = { 0, 6, 0, 0, 0 };
    static cilist io___2264 = { 0, 6, 0, 0, 0 };


 

 
 

 

 


    dainf_(inc, &inoc, &invc, &ipoc, &ilmc, &illc);

    daclr_(&c__1);

    i__1 = ipoc;
    for (i__ = ipoc + illc - 1; i__ >= i__1; --i__) {

	if (da_ .cc[i__ - 1] == 0.) {
	    s_wsle(&io___2262);
	    do_lio(&c__9, &c__1, "ERROR IN DAUNP AT 1 ", 20L);
	    e_wsle();
 
	}
	ic = da_ .ia1[da_ .i1[i__ - 1]] + da_ .ia2[da_ .i2[i__ - 1]];
	if (da_ .cc[ic - 1] != 0.) {
	    s_wsle(&io___2264);
	    do_lio(&c__9, &c__1, "ERROR IN DAUNP AT 2 ", 20L);
	    e_wsle();
 
	}

	da_ .cc[ic - 1] = da_ .cc[i__ - 1];

 
    }

    return 0;
}  

 
 
  int dachk_(ina, inoa, inva, inb, inob, invb, inc, inoc, invc)
integer *ina, *inoa, *inva, *inb, *inob, *invb, *inc, *inoc, *invc;
{
     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer ierr, invsum;

     
    static cilist io___2267 = { 0, 6, 0, 0, 0 };
    static cilist io___2268 = { 0, 6, 0, 0, 0 };


 

 
 


    if ((1) ) {
	return 0;
    }

    ierr = 0;

 
 

    if (*inob == -1 && *invb == -1) {
	invsum = *inva + *invc;
	if (invsum == 0) {
	    if (*inoa > *inoc) {
		ierr = 1;
	    }
	} else if (invsum == 1) {
	    ierr = 1;
	} else {
	    if (*inoa > *inoc || *inva > *invc) {
		ierr = 1;
	    }
	}
	if (ierr == 1) {
	    s_wsle(&io___2267);
	    do_lio(&c__9, &c__1, "ERROR IN DACHK INVA AND INVC", 28L);
	    do_lio(&c__9, &c__1, " ARE INCOMPATIBLE", 17L);
	    do_lio(&c__3, &c__1, (char *)&(*inoa), (ftnlen)sizeof(integer));
	    do_lio(&c__3, &c__1, (char *)&(*inva), (ftnlen)sizeof(integer));
	    do_lio(&c__3, &c__1, (char *)&(*inoc), (ftnlen)sizeof(integer));
	    do_lio(&c__3, &c__1, (char *)&(*invc), (ftnlen)sizeof(integer));
	    e_wsle();
 
	}

 
 

    } else {
	invsum = *inva + *invb + *invc;
	if (invsum == 0) {
	    if (*inoa > *inoc || *inob > *inoc) {
		ierr = 1;
	    }
	} else if (invsum == 1 || invsum == 2) {
	    ierr = 1;
	} else {
	    if (*inoa > *inoc || *inob > *inoc || *inva > *invc || *invb > *
		    invc) {
		ierr = 1;
	    }
	}
	if (ierr == 1) {
	    s_wsle(&io___2268);
	    do_lio(&c__9, &c__1, "ERROR IN DACHK INVA, INVB AND INVC", 34L);
	    do_lio(&c__9, &c__1, " ARE INCOMPATIBLE", 17L);
	    e_wsle();
 
	}
    }

    return 0;
}  

 
 
  int damch_(iaa, ia)
integer *iaa, *ia;
{
     
    integer i__1;

     
    integer s_wsle(), do_lio(), e_wsle();
      int s_stop();

     
    static integer i__, ino1, inv1, illa, ilma, ipoa, inoi, invi;
    extern   int dainf_();

     
    static cilist io___2277 = { 0, 6, 0, 0, 0 };


 

 
 


     
    --iaa;

     
    dainf_(&iaa[1], &ino1, &inv1, &ipoa, &ilma, &illa);

    i__1 = *ia;
    for (i__ = 2; i__ <= i__1; ++i__) {
	dainf_(&iaa[i__], &inoi, &invi, &ipoa, &ilma, &illa);
	if (ino1 != inoi || inv1 != invi) {
	    s_wsle(&io___2277);
	    do_lio(&c__9, &c__1, "ERROR IN DAMCH, VECTORS ", 24L);
	    do_lio(&c__3, &c__1, (char *)&iaa[1], (ftnlen)sizeof(integer));
	    do_lio(&c__9, &c__1, " AND ", 5L);
	    do_lio(&c__3, &c__1, (char *)&iaa[i__], (ftnlen)sizeof(integer));
	    do_lio(&c__9, &c__1, " ARE INCOMPATIBLE ", 18L);
	    e_wsle();
	    s_stop("", 0L);
	}
 
    }

    return 0;
}  


 
  int dadcd_(jj, ic1, ic2)
integer *jj, *ic1, *ic2;
{
     
    integer i__1;

     
    static integer i__, ibase, isplit;

 

 


 

 


     
    --jj;

     
    ibase = da_ .nomax + 1;
    isplit = (da_ .nvmax + 1) / 2;
    *ic1 = 0;
    *ic2 = 0;

    i__1 = isplit + 1;
    for (i__ = da_ .nvmax; i__ >= i__1; --i__) {
 
	*ic2 = *ic2 * ibase + jj[i__];
    }

    for (i__ = isplit; i__ >= 1; --i__) {
 
	*ic1 = *ic1 * ibase + jj[i__];
    }

    return 0;
}  


 
  int dancd_(ic1, ic2, jj)
integer *ic1, *ic2, *jj;
{
     
    integer i__1;
    doublereal d__1;

     
    integer i_dnnt();

     
    static integer i__;
    static doublereal x;
    static integer ic, ibase, isplit;

 

 


 

 


     
    --jj;

     
    ibase = da_ .nomax + 1;
    isplit = (da_ .nvmax + 1) / 2;

    ic = *ic1;
    i__1 = isplit;
    for (i__ = 1; i__ <= i__1; ++i__) {
	x = ic / (doublereal) ibase;
	ic = (integer) (x + da_ .epsmac);
 
	d__1 = ibase * (x - ic);
	jj[i__] = i_dnnt(&d__1);
    }

    ic = *ic2;
    i__1 = da_ .nvmax;
    for (i__ = isplit + 1; i__ <= i__1; ++i__) {
	x = ic / (doublereal) ibase;
	ic = (integer) (x + da_ .epsmac);
 
	d__1 = ibase * (x - ic);
	jj[i__] = i_dnnt(&d__1);
    }

    for (i__ = da_ .nvmax + 1; i__ <= 20; ++i__) {
 
	jj[i__] = 0;
    }

    return 0;
}  


 
doublereal dare_(ina)
integer *ina;
{
     
    integer i__1, i__2;
    doublereal ret_val;

     
    static integer j[20], ii, jj, ioa, illa, ilma, inoa, ipoa, inva;
    extern   int dancd_();

 
 
 

 

 

 


 

    inoa = da_ .idano[*ina - 1];
    inva = da_ .idanv[*ina - 1];
    ipoa = da_ .idapo[*ina - 1];
    ilma = da_ .idalm[*ina - 1];
    illa = da_ .idall[*ina - 1];
 
    if (da_ .nomax == 1) {
	ret_val = da_ .cc[ipoa - 1];
	return ret_val;
    }
 
 
 
 
    ioa = 0;
    i__1 = ipoa + illa - 1;
    for (ii = ipoa; ii <= i__1; ++ii) {
	if (da_ .ieo[da_ .ia1[da_ .i1[ii - 1]] + da_ .ia2[da_ .i2[ii - 1]] - 
		1] != ioa) {
	    goto L100;
	}
	dancd_(& da_ .i1[ii - 1], & da_ .i2[ii - 1], j);
	i__2 = inva;
	for (jj = 1; jj <= i__2; ++jj) {
	    if (j[jj - 1] != 0) {
		goto L100;
	    }
 
	}
	ret_val = da_ .cc[ipoa - 1];
	return ret_val;
L100:
	;
    }
    ret_val = 0.;
    return ret_val;
}  

 
  int mtree_(mb, ib, mc, ic)
integer *mb, *ib, *mc, *ic;
{
     
    integer i__1, i__2, i__3;
    doublereal d__1;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer i__, j, ii, jj[20], jl, jv[101], ib1, ic1, ic2, icc, iib, 
	    iic, ibi, ichk;
    static doublereal apek;
    static integer illb, ilmb, ilmc, illc, inob, inoc, ipob, ipoc, invb, invc,
	     jnon;
    extern   int dadcd_(), dadal_(), dapac_(), dancd_(), 
	    damch_(), daall_();
    static doublereal bbijj;
    extern   int dainf_(), dapek_(), daclr_();
    static doublereal chkjj;
    extern   int dapok_();
    static integer nterm, ntermf;

     
    static cilist io___2307 = { 0, 6, 0, 0, 0 };
    static cilist io___2323 = { 0, 6, 0, 0, 0 };
    static cilist io___2327 = { 0, 6, 0, 0, 0 };
    static cilist io___2328 = { 0, 6, 0, 0, 0 };
    static cilist io___2329 = { 0, 6, 0, 0, 0 };


 

 

 

 

 


 

 



 
 

     
    --mc;
    --mb;

     
    iib = mb[1];
    iic = mc[1];
    dainf_(&iib, &inob, &invb, &ipob, &ilmb, &illb);
    dainf_(&iic, &inoc, &invc, &ipoc, &ilmc, &illc);

    damch_(&mb[1], ib);
    damch_(&mc[1], ic);

    if (*ib != *ic) {
	s_wsle(&io___2307);
	do_lio(&c__9, &c__1, "ERROR IN MTREE, IB .NE. IC", 26L);
	e_wsle();
 
    }

 
 

    ichk = 0;
    daall_(&ichk, &c__1, "$$MTREE $$", & da_ .nomax, & da_ .nvmax, 10L);

 
 

    daclr_(&c__1);

    da_ .cc[0] = 1.;

    i__1 = *ib;
    for (i__ = 1; i__ <= i__1; ++i__) {
	if (da_ .nomax == 1) {
	    for (ib1 = 2; ib1 <= 7; ++ib1) {
		da_ .cc[ib1 - 1] = 1.;
 
	    }
	} else {
	    i__2 = da_ .idapo[mb[i__] - 1] + da_ .idall[mb[i__] - 1] - 1;
	    for (ibi = da_ .idapo[mb[i__] - 1]; ibi <= i__2; ++ibi) {
		icc = da_ .ia1[da_ .i1[ibi - 1]] + da_ .ia2[da_ .i2[ibi - 1]];
		if (da_ .ieo[icc - 1] > inob) {
		    goto L90;
		}
		da_ .cc[icc - 1] = 1.;
L90:
		;
	    }
	}
 
    }

    i__1 = inob;
    for (ii = 1; ii <= i__1; ++ii) {

 

	i__2 = da_ .nmmax;
	for (i__ = 1; i__ <= i__2; ++i__) {
	    if (da_ .cc[i__ - 1] < .5) {
		goto L140;
	    }

	    jnon = 0;
	    dancd_(& da_ .i1[i__ - 1], & da_ .i2[i__ - 1], jj);
	    i__3 = invb;
	    for (j = 1; j <= i__3; ++j) {
		if (jj[j - 1] == 0) {
		    goto L130;
		}
		jnon = j;
		--jj[j - 1];
		dadcd_(jj, &ic1, &ic2);
		apek = da_ .cc[da_ .ia1[ic1] + da_ .ia2[ic2] - 1];
		++jj[j - 1];
		if (apek >= .5) {
		    goto L140;
		}
L130:
		;
	    }

	    if (jnon == 0) {
		goto L140;
	    }

 

	    --jj[jnon - 1];
	    dadcd_(jj, &ic1, &ic2);
	    da_ .cc[da_ .ia1[ic1] + da_ .ia2[ic2] - 1] = 1.;

L140:
	    ;
	}
 
    }

    dapac_(&ichk, &c__0);
 

 
 

    ntermf = da_ .idall[ichk - 1];

 
 

    for (i__ = 1; i__ <= 20; ++i__) {
 
	jj[i__ - 1] = 0;
    }

    i__1 = *ib;
    for (i__ = 1; i__ <= i__1; ++i__) {
	dapek_(&mb[i__], jj, &bbijj);
	da_ .i1[da_ .idapo[mc[i__] - 1] - 1] = 0;
	da_ .i2[da_ .idapo[mc[i__] - 1] - 1] = 0;
	da_ .cc[da_ .idapo[mc[i__] - 1] - 1] = bbijj;
 
    }

    dapek_(&ichk, jj, &chkjj);
    if (chkjj > .5) {
	dapok_(&ichk, jj, &c_b2381);
    } else {
	s_wsle(&io___2323);
	do_lio(&c__9, &c__1, "ERROR IN MTREE, ZEROTH ORDER TERM OF ICHK IS ZERO", 49L);
	e_wsle();
 
    }

    nterm = 1;

 
 

    i__1 = inob;
    for (jl = 1; jl <= i__1; ++jl) {
 
	jv[jl] = 0;
    }

    jl = 0;
    chkjj = 1.;

L200:
    if (jl == 0 && chkjj <= .5) {
	goto L250;
    }
    if (jl < inob && chkjj > .5) {
	++jl;
	++jj[0];
	jv[jl] = 1;
    } else if (jv[jl] == invb) {
	--jj[jv[jl] - 1];
	jv[jl] = 0;
	--jl;
	chkjj = 0.;
	goto L200;
    } else {
	--jj[jv[jl] - 1];
	++jv[jl];
	++jj[jv[jl] - 1];
    }

    dapek_(&ichk, jj, &chkjj);

    if (chkjj <= .5) {
	goto L200;
    }

    ++nterm;
    if (nterm > da_ .idalm[mc[1] - 1]) {
	s_wsle(&io___2327);
	do_lio(&c__9, &c__1, "ERROR IN MTREE, NTERM TOO LARGE", 31L);
	e_wsle();
 
    }

    dapok_(&ichk, jj, &c_b2381);

 
    i__1 = *ib;
    for (i__ = 1; i__ <= i__1; ++i__) {
	dapek_(&mb[i__], jj, &bbijj);
	da_ .i1[da_ .idapo[mc[i__] - 1] + nterm - 2] = jl;
	da_ .i2[da_ .idapo[mc[i__] - 1] + nterm - 2] = jv[jl];
	da_ .cc[da_ .idapo[mc[i__] - 1] + nterm - 2] = bbijj;
 
    }

    goto L200;

L250:

    i__1 = *ib;
    for (i__ = 1; i__ <= i__1; ++i__) {
 
	da_ .idall[mc[i__] - 1] = nterm;
    }

 
 

    if (nterm != ntermf || nterm != da_ .idall[ichk - 1]) {
	s_wsle(&io___2328);
	do_lio(&c__9, &c__1, "ERROR IN MTREE, NTERM, NTERMF, IDALL(ICHK) =  ",
		 46L);
	do_lio(&c__3, &c__1, (char *)&nterm, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)&ntermf, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)& da_ .idall[ichk - 1], (ftnlen)sizeof(
		integer));
	e_wsle();
 
    }

    i__1 = da_ .idapo[ichk - 1] + nterm - 1;
    for (i__ = da_ .idapo[ichk - 1]; i__ <= i__1; ++i__) {
	if ((d__1 = da_ .cc[i__ - 1] + 1., (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > da_ .epsmac) {
	    s_wsle(&io___2329);
	    do_lio(&c__9, &c__1, "ERROR IN MTREE, NOT ALL TERMS IN ICHK ARE -1", 44L);
	    e_wsle();
 
	}
 
    }

    dadal_(&ichk, &c__1);

    return 0;
}  


 
  int ppush_(mc, ic, xi, xf)
integer *mc, *ic;
doublereal *xi, *xf;
{
     
    integer i__1, i__2;

     
    static integer i__, jl, iv, jv;
    static doublereal xm[101], xx;

 

 

 

 

 



     
    --xf;
    --xi;
    --mc;

     
    i__1 = *ic;
    for (i__ = 1; i__ <= i__1; ++i__) {
 
	xf[i__] = da_ .cc[da_ .idapo[mc[i__] - 1] - 1];
    }

    xm[0] = 1.;

    i__1 = da_ .idall[mc[1] - 1] - 1;
    for (i__ = 1; i__ <= i__1; ++i__) {

	jl = da_ .i1[da_ .idapo[mc[1] - 1] + i__ - 1];
	jv = da_ .i2[da_ .idapo[mc[1] - 1] + i__ - 1];
	xx = xm[jl - 1] * xi[jv];
	xm[jl] = xx;

	i__2 = *ic;
	for (iv = 1; iv <= i__2; ++iv) {
	    xf[iv] += da_ .cc[da_ .idapo[mc[iv] - 1] + i__ - 1] * xx;
 
	}
    }

    return 0;
}  


 
  int matinv_(a, ai, n, nmx, ier)
doublereal *a, *ai;
integer *n, *nmx, *ier;
{
     
    integer a_dim1, a_offset, ai_dim1, ai_offset, i__1, i__2;

     
    static doublereal d__;
    static integer i__, j;
    static doublereal aw[10000]	 ;
    static integer indx[100];
    extern   int lubksb_(), ludcmp_();

 

 
 
 
 
 
 

     
    ai_dim1 = *nmx;
    ai_offset = ai_dim1 + 1;
    ai -= ai_offset;
    a_dim1 = *nmx;
    a_offset = a_dim1 + 1;
    a -= a_offset;

     
    i__1 = *n;
    for (i__ = 1; i__ <= i__1; ++i__) {
	i__2 = *n;
	for (j = 1; j <= i__2; ++j) {
	    aw[i__ + j * 100 - 101] = a[i__ + j * a_dim1];
 
	    ai[i__ + j * ai_dim1] = (float)0.;
	}
 
	ai[i__ + i__ * ai_dim1] = (float)1.;
    }
    ludcmp_(aw, n, &c__100, indx, &d__, ier);
    if (*ier == 132) {
	return 0;
    }
    i__1 = *n;
    for (j = 1; j <= i__1; ++j) {
 
	lubksb_(aw, n, &c__100, indx, &ai[j * ai_dim1 + 1], nmx);
    }

    return 0;
}  


 
  int ludcmp_(a, n, np, indx, d__, ier)
doublereal *a;
integer *n, *np, *indx;
doublereal *d__;
integer *ier;
{
     
    integer a_dim1, a_offset, i__1, i__2, i__3;
    doublereal d__1, d__2;

     
    static integer i__, j, k;
    static doublereal vv[100], dum, sum;
    static integer imax;
    static doublereal aamax;

 

 
 
 
 
 

 

     
    --indx;
    a_dim1 = *np;
    a_offset = a_dim1 + 1;
    a -= a_offset;

     
    *ier = (float)0.;
    *d__ = (float)1.;
    i__1 = *n;
    for (i__ = 1; i__ <= i__1; ++i__) {
	aamax = (float)0.;
	i__2 = *n;
	for (j = 1; j <= i__2; ++j) {
	    if ((d__1 = a[i__ + j * a_dim1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > aamax) {
		aamax = (d__2 = a[i__ + j * a_dim1], (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) );
	    }
 
	}
	if (aamax == (float)0.) {
	    *ier = 132;
	    return 0;
	}
	vv[i__ - 1] = (float)1. / aamax;
 
    }
    i__1 = *n;
    for (j = 1; j <= i__1; ++j) {
	if (j > 1) {
	    i__2 = j - 1;
	    for (i__ = 1; i__ <= i__2; ++i__) {
		sum = a[i__ + j * a_dim1];
		if (i__ > 1) {
		    i__3 = i__ - 1;
		    for (k = 1; k <= i__3; ++k) {
			sum -= a[i__ + k * a_dim1] * a[k + j * a_dim1];
 
		    }
		    a[i__ + j * a_dim1] = sum;
		}
 
	    }
	}
	aamax = (float)0.;
	i__2 = *n;
	for (i__ = j; i__ <= i__2; ++i__) {
	    sum = a[i__ + j * a_dim1];
	    if (j > 1) {
		i__3 = j - 1;
		for (k = 1; k <= i__3; ++k) {
		    sum -= a[i__ + k * a_dim1] * a[k + j * a_dim1];
 
		}
		a[i__ + j * a_dim1] = sum;
	    }
	    dum = vv[i__ - 1] * (( sum ) >= 0 ? ( sum ) : -( sum )) ;
	    if (dum >= aamax) {
		imax = i__;
		aamax = dum;
	    }
 
	}
	if (j != imax) {
	    i__2 = *n;
	    for (k = 1; k <= i__2; ++k) {
		dum = a[imax + k * a_dim1];
		a[imax + k * a_dim1] = a[j + k * a_dim1];
		a[j + k * a_dim1] = dum;
 
	    }
	    *d__ = -(*d__);
	    vv[imax - 1] = vv[j - 1];
	}
	indx[j] = imax;
	if (j != *n) {
	    if (a[j + j * a_dim1] == (float)0.) {
		a[j + j * a_dim1] = 1e-20;
	    }
	    dum = (float)1. / a[j + j * a_dim1];
	    i__2 = *n;
	    for (i__ = j + 1; i__ <= i__2; ++i__) {
		a[i__ + j * a_dim1] *= dum;
 
	    }
	}
 
    }
    if (a[*n + *n * a_dim1] == (float)0.) {
	a[*n + *n * a_dim1] = 1e-20;
    }
    return 0;
}  


 
  int lubksb_(a, n, np, indx, b, nmx)
doublereal *a;
integer *n, *np, *indx;
doublereal *b;
integer *nmx;
{
     
    integer a_dim1, a_offset, i__1, i__2;

     
    static integer i__, j, ii, ll;
    static doublereal sum;

 

 
 
 
 
 
 

 

     
    --indx;
    a_dim1 = *np;
    a_offset = a_dim1 + 1;
    a -= a_offset;
    --b;

     
    ii = 0;
    i__1 = *n;
    for (i__ = 1; i__ <= i__1; ++i__) {
	ll = indx[i__];
	sum = b[ll];
	b[ll] = b[i__];
	if (ii != 0) {
	    i__2 = i__ - 1;
	    for (j = ii; j <= i__2; ++j) {
		sum -= a[i__ + j * a_dim1] * b[j];
 
	    }
	} else if (sum != (float)0.) {
	    ii = i__;
	}
	b[i__] = sum;
 
    }
    for (i__ = *n; i__ >= 1; --i__) {
	sum = b[i__];
	if (i__ < *n) {
	    i__1 = *n;
	    for (j = i__ + 1; j <= i__1; ++j) {
		sum -= a[i__ + j * a_dim1] * b[j];
 
	    }
	}
	b[i__] = sum / a[i__ + i__ * a_dim1];
 
    }
    return 0;
}  


 
 
  int datra_(idif, ina, inc)
integer *idif, *ina, *inc;
{
     
    integer i__1;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer i__;
    static doublereal x;
    static integer ic, jj, iee, ifac, illa, ilma, illc, ilmc, inoa, ipoa, 
	    inoc, ipoc, inva, invc, ider1, ider2;
    extern   int dachk_(), dainf_();
    static integer ibase;
    static doublereal xdivi;
    static integer ider1s, ider2s;

     
    static cilist io___2364 = { 0, 6, 0, 0, 0 };
    static cilist io___2377 = { 0, 6, 0, 0, 0 };


 

 

 

 

 


    dainf_(ina, &inoa, &inva, &ipoa, &ilma, &illa);
    dainf_(inc, &inoc, &invc, &ipoc, &ilmc, &illc);

    if (inva == 0 || invc == 0) {
	s_wsle(&io___2364);
	do_lio(&c__9, &c__1, "ERROR, DADER CALLED WITH CA VECTOR", 34L);
	e_wsle();
 
    }

    dachk_(ina, &inoa, &inva, &c__0, &c_n1, &c_n1, inc, &inoc, &invc);

    ibase = da_ .nomax + 1;

    if (*idif > (da_ .nvmax + 1) / 2) {
	ider1 = 0;
	ider1s = 0;
	ider2 = *idif - (da_ .nvmax + 1) / 2;
	ider2s = 1;
	i__1 = ider2 - 1;
	for (jj = 1; jj <= i__1; ++jj) {
 
	    ider2s *= ibase;
	}
	xdivi = (doublereal) (ider2s * ibase);
    } else {
	ider1 = *idif;
	ider1s = 1;
	i__1 = ider1 - 1;
	for (jj = 1; jj <= i__1; ++jj) {
 
	    ider1s *= ibase;
	}
	ider2 = 0;
	ider2s = 0;
	xdivi = (doublereal) (ider1s * ibase);
    }

    ibase = da_ .nomax + 1;

    ic = ipoc - 1;

    i__1 = ipoa + illa - 1;
    for (i__ = ipoa; i__ <= i__1; ++i__) {

	if (ider1 == 0) {
	    iee = da_ .i2[i__ - 1];
	} else {
	    iee = da_ .i1[i__ - 1];
	}

	x = iee / xdivi;
	ifac = (integer) (ibase * (x - (integer) x + 1e-8));

	if (ifac == 0) {
	    goto L100;
	}

	++ic;
	da_ .cc[ic - 1] = da_ .cc[i__ - 1];
	da_ .i1[ic - 1] = da_ .i1[i__ - 1] - ider1s;
	da_ .i2[ic - 1] = da_ .i2[i__ - 1] - ider2s;

L100:
	;
    }

    da_ .idall[*inc - 1] = ic - ipoc + 1;
    if (da_ .idall[*inc - 1] > da_ .idalm[*inc - 1]) {
	s_wsle(&io___2377);
	do_lio(&c__9, &c__1, "ERROR IN DATRA ", 15L);
	e_wsle();
 
    }

    return 0;
}  

 
  int dasym_(mb, mbdp, mbp, mbd, ib, mc, ic, n, ma, ia)
integer *mb, *mbdp, *mbp, *mbd, *ib, *mc, *ic, *n, *ma, *ia;
{
     
    integer i__1, i__2, i__3, i__4, i__5;
    doublereal d__1;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer i__, j, k, j1;
    static doublereal dm[9]	 ;
    static integer ie, ig, if__, jj;
    static doublereal xd[9];
    static integer it;
    static doublereal xf[20], xi[20];
    static integer ic2, mbb[20];
    static doublereal dmi[9]	 , xci[20];
    static integer ibb, iet, ier, iee, ife;
    static doublereal xet, xtw[20];
    static integer mbdb[20], mbpb[20];
    extern   int daall_();
    static integer mbdpb[20];
    extern   int dapek_(), dapok_(), mtree_(), ppush_(), 
	    matinv_();

     
    static cilist io___2378 = { 0, 6, 0, 0, 0 };
    static cilist io___2404 = { 0, 4, 0, 0, 0 };


 

 
 

 
 

 

 

 



     
    --ma;
    --mc;
    --mbd;
    --mbp;
    --mbdp;
    --mb;

     
    if (da_ .idalm[mc[1] - 1] * (( *n ) >= 0 ? ( *n ) : -( *n ))  > da_ .idalm[ma[1] - 1]) {
	s_wsle(&io___2378);
	do_lio(&c__9, &c__1, "ERROR IN ROUTINE DASYM, IA.LT.IC*|N|", 36L);
	e_wsle();
 
    }

 
    i__1 = *ib;
    ibb = i__1 * i__1 / 4;
    daall_(mbb, ib, "$$DATRK $$", & da_ .nomax, & da_ .nvmax, 10L);
    daall_(mbpb, ib, "$ETIENNE $", & da_ .nomax, & da_ .nvmax, 10L);
    daall_(mbdb, &ibb, "$FOREST  $", & da_ .nomax, & da_ .nvmax, 10L);
    daall_(mbdpb, ib, "$FOREST1 $", & da_ .nomax, & da_ .nvmax, 10L);

    mtree_(&mb[1], ib, mbb, ib);
    mtree_(&mbd[1], &ibb, mbdb, &ibb);
    mtree_(&mbp[1], ib, mbpb, ib);
    mtree_(&mbdp[1], ib, mbdpb, ib);

    ic2 = *ib / 2;
    for (i__ = 1; i__ <= 3; ++i__) {
 
	dm[i__ + i__ * 3 - 4] = 1.;
    }
    i__1 = da_ .idall[mc[1] - 1];
    for (i__ = 1; i__ <= i__1; ++i__) {

	i__2 = *ic;
	for (j = 1; j <= i__2; ++j) {
	    dapek_(&mc[j], &i__, &xi[j - 1]);
	    i__3 = (i__ - 1) * *n + 1;
	    dapok_(&ma[j], &i__3, &xi[j - 1]);
 
	}
	i__2 = (( *n ) >= 0 ? ( *n ) : -( *n )) ;
	for (k = 2; k <= i__2; ++k) {

 
	    xet = 0.;
	    i__3 = *ib;
	    for (iet = 1; iet <= i__3; ++iet) {
		xet = (d__1 = xi[iet - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) + xet;
 
	    }
	    if (xet > 1e3) {
		*n = k;
		return 0;
	    }
 
	    ppush_(mbb, ib, xi, xf);
 
 

	    i__3 = ic2;
	    for (ie = 1; ie <= i__3; ++ie) {
		xtw[(ie << 1) - 2] = xi[(ie << 1) - 2];
 
		xtw[(ie << 1) - 1] = xf[(ie << 1) - 1];
	    }
	    i__3 = *ic;
	    for (ie = *ib + 1; ie <= i__3; ++ie) {
 
		xtw[ie - 1] = xi[ie - 1];
	    }
	    i__3 = newton_ .nitera;
	    for (it = 1; it <= i__3; ++it) {
		ppush_(mbpb, ib, xtw, xci);
		ppush_(mbdb, &ibb, xtw, xd);
 
 
 
		ig = 1;
		i__4 = ic2;
		for (ie = 1; ie <= i__4; ++ie) {
		    xci[(ie << 1) - 1] -= xi[(ie << 1) - 1];
		    i__5 = ic2;
		    for (if__ = 1; if__ <= i__5; ++if__) {
			dm[ie + if__ * 3 - 4] = xd[ig - 1];
 
			++ig;
		    }
 
		}
		matinv_(dm, dmi, &c__3, &c__3, &ier);
		i__4 = ic2;
		for (ie = 1; ie <= i__4; ++ie) {
		    i__5 = ic2;
		    for (if__ = 1; if__ <= i__5; ++if__) {
			iee = ie << 1;
			ife = if__ << 1;
			xtw[iee - 1] += dmi[ie + if__ * 3 - 4] * xci[ife - 1];
 
		    }
 
		}
 
		xet = 0.;
		i__4 = ic2;
		for (iet = 1; iet <= i__4; ++iet) {
		    xet = (d__1 = xtw[(iet << 1) - 1] - xf[(iet << 1) - 1], 
			    (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) + xet;
 
		}
		if (xet < newton_ .epss) {
 
		    goto L666;
		} else {
		    i__4 = ic2;
		    for (ie = 1; ie <= i__4; ++ie) {
 
			xf[(ie << 1) - 1] = xtw[(ie << 1) - 1];
		    }
		    i__4 = *ic;
		    for (ie = *ib + 1; ie <= i__4; ++ie) {
 
			xf[ie - 1] = xtw[ie - 1];
		    }
		}
 
	    }
	    s_wsle(&io___2404);
	    do_lio(&c__3, &c__1, (char *)&k, (ftnlen)sizeof(integer));
	    do_lio(&c__3, &c__1, (char *)&it, (ftnlen)sizeof(integer));
	    do_lio(&c__5, &c__1, (char *)&xet, (ftnlen)sizeof(doublereal));
	    e_wsle();
L666:
	    ppush_(mbdpb, ib, xtw, xf);
 
 
 

	    i__3 = ic2;
	    for (j1 = 1; j1 <= i__3; ++j1) {
		j = (j1 << 1) - 1;
		jj = j1 << 1;
		xi[j - 1] = xf[j - 1];
		xi[jj - 1] = xtw[jj - 1];
		i__4 = (i__ - 1) * *n + k;
		dapok_(&ma[j], &i__4, &xi[j - 1]);
		i__4 = (i__ - 1) * *n + k;
		dapok_(&ma[jj], &i__4, &xi[jj - 1]);
 
	    }
	    i__3 = *ia;
	    for (j1 = *ib + 1; j1 <= i__3; ++j1) {
		xi[j1 - 1] = xf[j1 - 1];
		i__4 = (i__ - 1) * *n + k;
		dapok_(&ma[j1], &i__4, &xi[j1 - 1]);
 
	    }

 
	}
    }

    return 0;
}  


 
  int datrke_(mb, ib, mc, ic, n, ma, ia)
integer *mb, *ib, *mc, *ic, *n, *ma, *ia;
{
     
    integer i__1, i__2, i__3, i__4;
    doublereal d__1;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer i__, j, k;
    static doublereal xf[20], xi[20];
    static integer mbb[20], iet;
    static doublereal xet;
    extern   int daall_(), dapek_(), dapok_(), mtree_(), 
	    ppush_();

     
    static cilist io___2407 = { 0, 6, 0, 0, 0 };


 

 
 

 
 

 

 

 



     
    --ma;
    --mc;
    --mb;

     
    if (da_ .idalm[mc[1] - 1] * (( *n ) >= 0 ? ( *n ) : -( *n ))  > da_ .idalm[ma[1] - 1]) {
	s_wsle(&io___2407);
	do_lio(&c__9, &c__1, "ERROR IN ROUTINE DATRKE, IA.LT.IC*|N|", 37L);
	e_wsle();
 
    }

    daall_(mbb, ib, "$$DATRK $$", & da_ .nomax, & da_ .nvmax, 10L);

    mtree_(&mb[1], ib, mbb, ib);

    i__1 = da_ .idall[mc[1] - 1];
    for (i__ = 1; i__ <= i__1; ++i__) {

	i__2 = *ic;
	for (j = 1; j <= i__2; ++j) {
	    dapek_(&mc[j], &i__, &xi[j - 1]);
	    i__3 = (i__ - 1) * *n + 1;
	    dapok_(&ma[j], &i__3, &xi[j - 1]);
 
	}
	i__2 = (( *n ) >= 0 ? ( *n ) : -( *n )) ;
	for (k = 2; k <= i__2; ++k) {

 
	    xet = 0.;
	    i__3 = *ic;
	    for (iet = 1; iet <= i__3; ++iet) {
		xet = (d__1 = xi[iet - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) + xet;
 
	    }
	    if (xet > 1e3) {
		*n = k;
		return 0;
	    }
 
	    ppush_(mbb, ib, xi, xf);

	    if (*n < 0) {
	    }

	    i__3 = *ic;
	    for (j = 1; j <= i__3; ++j) {
		xi[j - 1] = xf[j - 1];
		i__4 = (i__ - 1) * *n + k;
		dapok_(&ma[j], &i__4, &xi[j - 1]);
 
	    }

 
	}
    }

    return 0;
}  

 
 
  int dasymf_(lin, mb, mbdp, mbp, mbd, ib, mc, ic, n, ma, ia)
integer *lin, *mb, *mbdp, *mbp, *mbd, *ib, *mc, *ic, *n, *ma, *ia;
{
     
    integer i__1, i__2, i__3, i__4, i__5;
    doublereal d__1;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer i__, j, k, j1;
    static doublereal dm[9]	 ;
    static integer ii, ie, ig, if__, jj;
    static doublereal xd[9];
    static integer it;
    static doublereal xf[20], xi[20];
    static integer ic2, mbb[20];
    static doublereal dmi[9]	 , xci[20];
    static integer ibb, iet, ier, iee, ife;
    static doublereal xet, xtw[20];
    static integer mbdb[20], mbpb[20], mlin[20];
    extern   int daall_();
    static integer mbdpb[20];
    extern   int dapek_(), dapok_(), mtree_(), ppush_(), 
	    matinv_();

     
    static cilist io___2416 = { 0, 6, 0, 0, 0 };
    static cilist io___2444 = { 0, 4, 0, 0, 0 };


 

 
 

 
 

 

 

 



     
    --ma;
    --mc;
    --mbd;
    --mbp;
    --mbdp;
    --mb;
    --lin;

     
    if (da_ .idalm[mc[1] - 1] * (( *n ) >= 0 ? ( *n ) : -( *n ))  > da_ .idalm[ma[1] - 1]) {
	s_wsle(&io___2416);
	do_lio(&c__9, &c__1, "ERROR IN ROUTINE DASYMF, IA.LT.IC*|N|", 37L);
	e_wsle();
 
    }

 
    i__1 = *ib;
    ibb = i__1 * i__1 / 4;
    daall_(mbb, ib, "$$DATRK $$", & da_ .nomax, & da_ .nvmax, 10L);
    daall_(mbpb, ib, "$ETIENNE $", & da_ .nomax, & da_ .nvmax, 10L);
    daall_(mbdb, &ibb, "$FOREST  $", & da_ .nomax, & da_ .nvmax, 10L);
    daall_(mbdpb, ib, "$FOREST1 $", & da_ .nomax, & da_ .nvmax, 10L);
    daall_(mlin, ib, "$NERI  1 $", & da_ .nomax, & da_ .nvmax, 10L);

    mtree_(&mb[1], ib, mbb, ib);
    mtree_(&mbd[1], &ibb, mbdb, &ibb);
    mtree_(&mbp[1], ib, mbpb, ib);
    mtree_(&mbdp[1], ib, mbdpb, ib);
    mtree_(&lin[1], ib, mlin, ib);

    ic2 = *ib / 2;
    for (i__ = 1; i__ <= 3; ++i__) {
 
	dm[i__ + i__ * 3 - 4] = 1.;
    }
    i__1 = da_ .idall[mc[1] - 1];
    for (i__ = 1; i__ <= i__1; ++i__) {

	i__2 = *ic;
	for (j = 1; j <= i__2; ++j) {
	    dapek_(&mc[j], &i__, &xi[j - 1]);
	    i__3 = (i__ - 1) * *n + 1;
	    dapok_(&ma[j], &i__3, &xi[j - 1]);
 
	}
	i__2 = (( *n ) >= 0 ? ( *n ) : -( *n )) ;
	for (k = 2; k <= i__2; ++k) {

 
	    xet = 0.;
	    i__3 = *ib;
	    for (iet = 1; iet <= i__3; ++iet) {
		xet = (d__1 = xi[iet - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) + xet;
 
	    }
	    if (xet > 1e3) {
		*n = k;
		return 0;
	    }
 
	    ppush_(mlin, ib, xi, xf);
	    i__3 = *ib;
	    for (ii = 1; ii <= i__3; ++ii) {
 
		xi[ii - 1] = xf[ii - 1];
	    }
	    ppush_(mbb, ib, xi, xf);
 
 

	    i__3 = ic2;
	    for (ie = 1; ie <= i__3; ++ie) {
		xtw[(ie << 1) - 2] = xi[(ie << 1) - 2];
 
		xtw[(ie << 1) - 1] = xf[(ie << 1) - 1];
	    }
	    i__3 = *ic;
	    for (ie = *ib + 1; ie <= i__3; ++ie) {
 
		xtw[ie - 1] = xi[ie - 1];
	    }
	    i__3 = newton_ .nitera;
	    for (it = 1; it <= i__3; ++it) {
		ppush_(mbpb, ib, xtw, xci);
		ppush_(mbdb, &ibb, xtw, xd);
 
 
 
		ig = 1;
		i__4 = ic2;
		for (ie = 1; ie <= i__4; ++ie) {
		    xci[(ie << 1) - 1] -= xi[(ie << 1) - 1];
		    i__5 = ic2;
		    for (if__ = 1; if__ <= i__5; ++if__) {
			dm[ie + if__ * 3 - 4] = xd[ig - 1];
 
			++ig;
		    }
 
		}
		matinv_(dm, dmi, &c__3, &c__3, &ier);
		i__4 = ic2;
		for (ie = 1; ie <= i__4; ++ie) {
		    i__5 = ic2;
		    for (if__ = 1; if__ <= i__5; ++if__) {
			iee = ie << 1;
			ife = if__ << 1;
			xtw[iee - 1] += dmi[ie + if__ * 3 - 4] * xci[ife - 1];
 
		    }
 
		}
 
		xet = 0.;
		i__4 = ic2;
		for (iet = 1; iet <= i__4; ++iet) {
		    xet = (d__1 = xtw[(iet << 1) - 1] - xf[(iet << 1) - 1], 
			    (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) + xet;
 
		}
		if (xet < newton_ .epss) {
 
		    goto L666;
		} else {
		    i__4 = ic2;
		    for (ie = 1; ie <= i__4; ++ie) {
 
			xf[(ie << 1) - 1] = xtw[(ie << 1) - 1];
		    }
		    i__4 = *ic;
		    for (ie = *ib + 1; ie <= i__4; ++ie) {
 
			xf[ie - 1] = xtw[ie - 1];
		    }
		}
 
	    }
	    s_wsle(&io___2444);
	    do_lio(&c__3, &c__1, (char *)&k, (ftnlen)sizeof(integer));
	    do_lio(&c__3, &c__1, (char *)&it, (ftnlen)sizeof(integer));
	    do_lio(&c__5, &c__1, (char *)&xet, (ftnlen)sizeof(doublereal));
	    e_wsle();
L666:
	    ppush_(mbdpb, ib, xtw, xf);
 
 
 

	    i__3 = ic2;
	    for (j1 = 1; j1 <= i__3; ++j1) {
		j = (j1 << 1) - 1;
		jj = j1 << 1;
		xi[j - 1] = xf[j - 1];
		xi[jj - 1] = xtw[jj - 1];
		i__4 = (i__ - 1) * *n + k;
		dapok_(&ma[j], &i__4, &xi[j - 1]);
		i__4 = (i__ - 1) * *n + k;
		dapok_(&ma[jj], &i__4, &xi[jj - 1]);
 
	    }
	    i__3 = *ia;
	    for (j1 = *ib + 1; j1 <= i__3; ++j1) {
		xi[j1 - 1] = xf[j1 - 1];
		i__4 = (i__ - 1) * *n + k;
		dapok_(&ma[j1], &i__4, &xi[j1 - 1]);
 
	    }

 
	}
    }

    return 0;
}  


 
  int dareat_(ina, iunit, nvori)
integer *ina, *iunit, *nvori;
{
     
    integer i__1, i__2;
    alist al__1;

     
    integer s_wsle(), do_lio(), e_wsle();
      int s_stop();
    integer f_rew(), s_rsle(), e_rsle(), s_rsfe(), do_fio(), e_rsfe();

     
    static doublereal c__;
    static integer i__, j[20];
    static char c10[10];
    static integer ic, ie, ii, jj, io, jr[400]	 , nn, ii1, 
	    ii2, io1, iin, iet, illa, ilma, inoa, ipoa, inva;
    extern   int dadcd_(), dapac_(), daclr_();
    static integer iwarin, iwarno, iwarnv;

     
    static cilist io___2447 = { 0, 6, 0, 0, 0 };
    static cilist io___2453 = { 0, 4, 0, 0, 0 };
    static cilist io___2456 = { 0, 4, 0, 0, 0 };
    static cilist io___2465 = { 0, 0, 0, "(A10)", 0 };
    static cilist io___2467 = { 0, 0, 0, "(A10)", 0 };
    static cilist io___2468 = { 0, 0, 0, "(A10)", 0 };
    static cilist io___2469 = { 0, 0, 0, "(A10)", 0 };
    static cilist io___2470 = { 0, 0, 0, "(A10)", 0 };
    static cilist io___2472 = { 0, 0, 0, "(I6,2X,G20.14,I5,4X,18(2I2,1X))", 0 
	    };
    static cilist io___2476 = { 0, 0, 0, 0, 0 };


 

 

 

 

 



    if (*ina < 1 || *ina > da_ .nda) {
	s_wsle(&io___2447);
	do_lio(&c__9, &c__1, "ERROR IN DAPRI, INA = ", 22L);
	do_lio(&c__3, &c__1, (char *)&(*ina), (ftnlen)sizeof(integer));
	e_wsle();
 
 
	s_stop("", 0L);
    }

    inoa = da_ .idano[*ina - 1];
    inva = da_ .idanv[*ina - 1];
    ipoa = da_ .idapo[*ina - 1];
    ilma = da_ .idalm[*ina - 1];
    illa = da_ .idall[*ina - 1];
    al__1.aerr = 0;
    al__1.aunit = 4;
    f_rew(&al__1);
    s_rsle(&io___2453);
    do_lio(&c__3, &c__1, (char *)&nn, (ftnlen)sizeof(integer));
    e_rsle();
    i__1 = nn;
    for (i__ = 1; i__ <= i__1; ++i__) {
	s_rsle(&io___2456);
	i__2 = *nvori - inva;
	for (jj = 1; jj <= i__2; ++jj) {
	    do_lio(&c__3, &c__1, (char *)&jr[jj + i__ * 20 - 21], (ftnlen)
		    sizeof(integer));
	}
	e_rsle();
 
    }

    for (i__ = 1; i__ <= 20; ++i__) {
 
	j[i__ - 1] = 0;
    }

    daclr_(&c__1);

    ic = 0;

    iwarno = 0;
    iwarnv = 0;
    iwarin = 0;
 
    iet = 0;
 

    io___2465.ciunit = *iunit;
    s_rsfe(&io___2465);
    do_fio(&c__1, c10, 10L);
    e_rsfe();
    io___2467.ciunit = *iunit;
    s_rsfe(&io___2467);
    do_fio(&c__1, c10, 10L);
    e_rsfe();
    io___2468.ciunit = *iunit;
    s_rsfe(&io___2468);
    do_fio(&c__1, c10, 10L);
    e_rsfe();
    io___2469.ciunit = *iunit;
    s_rsfe(&io___2469);
    do_fio(&c__1, c10, 10L);
    e_rsfe();
    io___2470.ciunit = *iunit;
    s_rsfe(&io___2470);
    do_fio(&c__1, c10, 10L);
    e_rsfe();

    iin = 0;

L10:
    ++iin;
    io___2472.ciunit = *iunit;
    s_rsfe(&io___2472);
    do_fio(&c__1, (char *)&ii, (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)&c__, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)&io, (ftnlen)sizeof(integer));
    i__1 = *nvori;
    for (i__ = 1; i__ <= i__1; ++i__) {
	do_fio(&c__1, (char *)&j[i__ - 1], (ftnlen)sizeof(integer));
    }
    e_rsfe();

    if (ii == 0) {
	goto L20;
    }
 
    io___2476.ciunit = *iunit;
    s_rsle(&io___2476);
    do_lio(&c__5, &c__1, (char *)&c__, (ftnlen)sizeof(doublereal));
    e_rsle();
 
    io1 = 0;
    i__1 = inva;
    for (i__ = 1; i__ <= i__1; ++i__) {
 
	io1 += j[i__ - 1];
    }
    if (io1 > inoa) {
	goto L10;
    }
    i__1 = nn;
    for (i__ = 1; i__ <= i__1; ++i__) {
	i__2 = *nvori;
	for (ie = inva + 1; ie <= i__2; ++ie) {
	    if (j[ie - 1] != jr[ie - inva + i__ * 20 - 21]) {
		goto L56;
	    }
 
	}
	goto L57;
L56:
	;
    }
    goto L10;
L57:
    i__1 = *nvori;
    for (i__ = inva + 1; i__ <= i__1; ++i__) {
 
	j[i__ - 1] = 0;
    }
    ++ic;
    dadcd_(j, &ii1, &ii2);
    ic = da_ .ia1[ii1] + da_ .ia2[ii2];
    da_ .cc[ic - 1] = c__;
    goto L10;

L20:

    dapac_(ina, &c__1);

    return 0;
}  


doublereal gam6_(j)
integer *j;
{
     
    doublereal ret_val;

     
    static integer i__, jj[3];

     
    --j;

     
    ret_val = 0.;
    for (i__ = 1; i__ <= 3; ++i__) {
 
	jj[i__ - 1] = j[(i__ << 1) - 1] - j[i__ * 2];
    }
    ret_val = tune_ .aam[jj[0] + (jj[1] + jj[2] * 41) * 41 + 34460];
    return ret_val;
}  

doublereal gbm6_(j)
integer *j;
{
     
    doublereal ret_val;

     
    static integer i__, jj[3];

     
    --j;

     
    ret_val = 0.;
    for (i__ = 1; i__ <= 3; ++i__) {
 
	jj[i__ - 1] = j[(i__ << 1) - 1] - j[i__ * 2];
    }
    ret_val = tune_ .abm[jj[0] + (jj[1] + jj[2] * 41) * 41 + 34460];
    return ret_val;
}  

 
  int gofix6_(xy, x, v, w, rel, a1, a1i, nord)
integer *xy, *x, *v, *w, *rel, *a1, *a1i, *nord;
{
    extern   int daall_(), dacct_(), dainv_(), danot_(), 
	    dacond6_(), dacopd6_(), dalind6_();

 
 
 
 




     
    --a1i;
    --a1;
    --rel;
    --w;
    --v;
    --x;
    --xy;

     
    daall_(&xy[1], &c__12, "XY        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&x[1], &c__12, "X         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&w[1], &c__12, "W         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&v[1], &c__12, "V         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&rel[1], &c__12, "REL       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&a1[1], &c__12, "A1        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&a1i[1], &c__12, "A1I       ", & ii_ .no, & ii_ .nv, 10L);
 
 
    danot_(nord);
    dacopd6_(&xy[1], &x[1]);
    dalind6_(&x[1], &c_b2366, &rel[1], &c_b2381, &v[1]);
    dainv_(&v[1], & ii_ .nv, &w[1], & ii_ .nv);
    dacond6_(&x[1], &c_b251);
    dacct_(&w[1], &c__6, &x[1], & ii_ .nv, &v[1], &c__6);
    dalind6_(&rel[1], &c_b2366, &v[1], &c_b2366, &a1[1]);
    dalind6_(&rel[1], &c_b2366, &v[1], &c_b2381, &a1i[1]);
    danot_(& ii_ .no);
 
    dacct_(&a1i[1], &c__6, &xy[1], & ii_ .nv, &v[1], &c__6);
    dacct_(&v[1], &c__6, &a1[1], & ii_ .nv, &x[1], &c__6);
    return 0;
}  

  int hbook2_(i1, c1, i2, r1, r2, i3, r3, r4, r5, c1_len)
integer *i1;
char *c1;
integer *i2;
doublereal *r1, *r2;
integer *i3;
doublereal *r3, *r4, *r5;
ftnlen c1_len;
{
    return 0;
}  

  int hdelet_(i1)
integer *i1;
{
    return 0;
}  

  int hlimit_(i1)
integer *i1;
{
    return 0;
}  

  int hplax_(c1, c2, c1_len, c2_len)
char *c1, *c2;
ftnlen c1_len;
ftnlen c2_len;
{
    return 0;
}  

  int hplcap_(i1)
integer *i1;
{
    return 0;
}  

  int hplend_()
{
    return 0;
}  

  int hplint_(i1)
integer *i1;
{
    return 0;
}  

  int hplopt_(c1, i1, c1_len)
char *c1;
integer *i1;
ftnlen c1_len;
{
    return 0;
}  

  int hplot_(i1, c1, c2, i2, c1_len, c2_len)
integer *i1;
char *c1, *c2;
integer *i2;
ftnlen c1_len;
ftnlen c2_len;
{
    return 0;
}  

  int hplset_(c1, r1, c1_len)
char *c1;
doublereal *r1;
ftnlen c1_len;
{
    return 0;
}  

  int hplsiz_(r1, r2, c1, c1_len)
doublereal *r1, *r2;
char *c1;
ftnlen c1_len;
{
    return 0;
}  

  int hplsof_(r1, r2, c1, r3, r4, r5, i1, c1_len)
doublereal *r1, *r2;
char *c1;
doublereal *r3, *r4, *r5;
integer *i1;
ftnlen c1_len;
{
    return 0;
}  

  int htitle_(c1, c1_len)
char *c1;
ftnlen c1_len;
{
    return 0;
}  

  int ipl_(i1, r1, r2)
integer *i1;
doublereal *r1, *r2;
{
    return 0;
}  

  int ipm_(i1, r1, r2)
integer *i1;
doublereal *r1, *r2;
{
    return 0;
}  

  int iselnt_(i1)
integer *i1;
{
    return 0;
}  

 
  int htal_(a, m, n, k, beta)
doublereal *a;
integer *m, *n, *k;
doublereal *beta;
{
     
    integer i__1, i__2;

     
    static doublereal h__;
    static integer j, k1, nc;

 

 
 
 
 
 

 
     
    a -= 601;

     
    nc = *n - *k;
    i__1 = nc;
    for (j = 1; j <= i__1; ++j) {
	h__ = 0.;
	i__2 = *m;
	for (k1 = *k; k1 <= i__2; ++k1) {
 
	    h__ += a[k1 + *k * 600] * a[k1 + (*k + j) * 600];
	}
	h__ = *beta * h__;
	i__2 = *m;
	for (k1 = *k; k1 <= i__2; ++k1) {
 
	    a[k1 + (*k + j) * 600] -= a[k1 + *k * 600] * h__;
	}
    }
}  

 
  int htbl_(a, b, m, n, k, beta)
doublereal *a, *b;
integer *m, *n, *k;
doublereal *beta;
{
     
    integer i__1;

     
    static doublereal h__;
    static integer k1;

 

 
 
 
 
 

 
     
    --b;
    a -= 601;

     
    h__ = 0.;
    i__1 = *m;
    for (k1 = *k; k1 <= i__1; ++k1) {
 
	h__ += a[k1 + *k * 600] * b[k1];
    }
    h__ = *beta * h__;
    i__1 = *m;
    for (k1 = *k; k1 <= i__1; ++k1) {
 
	b[k1] -= a[k1 + *k * 600] * h__;
    }
}  

 
  int htls_(a, b, m, n, x, ipiv, r__, iter, rms, ptp)
doublereal *a, *b;
integer *m, *n;
doublereal *x;
integer *ipiv;
doublereal *r__;
integer *iter;
doublereal *rms, *ptp;
{
     
    static char fmt_10000[] = "(a,i4)";

     
    integer i__1, i__2, i__3;

     
    double sqrt();
    integer s_wsle(), e_wsle(), do_lio(), s_wsfe(), do_fio(), e_wsfe();
      int s_stop();

     
    static doublereal g, h__;
    static integer i__, j, k, j1, k2, k3, ki, kk, ip, ij1, iii;
    static doublereal sig, rho[1800], piv, beta;
    extern   int htal_(), htbl_();
    static integer kpiv;
    extern   int htrl_(), htul_();
    static doublereal ptop[600], pivt, rmss[600], xrms[600], xptp[600], xiter[
	    600];
    extern   int calrms_();

     
    static cilist io___2507 = { 0, 6, 0, 0, 0 };
    static cilist io___2508 = { 0, 6, 0, 0, 0 };
    static cilist io___2509 = { 0, 6, 0, 0, 0 };
    static cilist io___2510 = { 0, 6, 0, 0, 0 };
    static cilist io___2511 = { 0, 6, 0, fmt_10000, 0 };


 

 
 
 
 
 

 
 
 
 
 
 
 
 
     
    --r__;
    --ipiv;
    --x;
    --b;
    a -= 601;

     
    beta = (float)0.;
    for (ij1 = 1; ij1 <= 500; ++ij1) {
 
	rho[ij1 - 1] = (float)0.;
    }
    k2 = *n + 1;
    piv = 0.;
    i__1 = *n;
    for (k = 1; k <= i__1; ++k) {
	ipiv[k] = k;
	h__ = 0.;
	g = 0.;
	i__2 = *m;
	for (i__ = 1; i__ <= i__2; ++i__) {
	    h__ += a[i__ + k * 600] * a[i__ + k * 600];
	    g += a[i__ + k * 600] * b[i__];
 
	}
	rho[k - 1] = h__;
	rho[k2 - 1] = g;
	pivt = g * g / h__;
	if (pivt - piv <= 0.) {
	    goto L40;
	} else {
	    goto L30;
	}
L30:
	piv = pivt;
	kpiv = k;
L40:
	++k2;
    }
 
    i__1 = *iter;
    for (k = 1; k <= i__1; ++k) {
	if (kpiv == k) {
	    goto L60;
	}
 
	h__ = rho[k - 1];
	rho[k - 1] = rho[kpiv - 1];
	rho[kpiv - 1] = h__;
	k2 = *n + k;
	k3 = *n + kpiv;
	g = rho[k2 - 1];
	rho[k2 - 1] = rho[k3 - 1];
	rho[k3 - 1] = g;
	i__2 = *m;
	for (i__ = 1; i__ <= i__2; ++i__) {
	    h__ = a[i__ + k * 600];
	    a[i__ + k * 600] = a[i__ + kpiv * 600];
	    a[i__ + kpiv * 600] = h__;
 
	}
 
L60:
	htul_(&a[601], m, n, &k, &sig, &beta);
 
	j = *n + k;
	rho[j - 1] = -sig;
	ip = ipiv[kpiv];
	ipiv[kpiv] = ipiv[k];
	ipiv[k] = ip;
	if (k == *n) {
	    goto L70;
	}
 
	htal_(&a[601], m, n, &k, &beta);
 
L70:
	htbl_(&a[601], &b[1], m, n, &k, &beta);
 
 
	rho[k - 1] = sqrt(piv);
	if (k == *n) {
	    goto L90;
	}
	piv = 0.;
	kpiv = k + 1;
	j1 = kpiv;
	k2 = *n + j1;
	i__2 = *n;
	for (j = j1; j <= i__2; ++j) {
	    h__ = rho[j - 1] - a[k + j * 600] * a[k + j * 600];
	    if (h__ < (float)1e-7) {
		s_wsle(&io___2507);
		e_wsle();
		s_wsle(&io___2508);
		do_lio(&c__9, &c__1, "CORRECTION PROCESS ABORTED.", 27L);
		e_wsle();
		s_wsle(&io___2509);
		do_lio(&c__9, &c__1, "DIVISION BY ZERO EXPECTED.", 26L);
		e_wsle();
		s_wsle(&io___2510);
		do_lio(&c__9, &c__1, "PROBABLY TWO CORRECTORS TOO CLOSE.", 
			34L);
		e_wsle();
		s_wsfe(&io___2511);
		do_fio(&c__1, " SUSPECTED CORRECTOR: ", 22L);
		do_fio(&c__1, (char *)&j, (ftnlen)sizeof(integer));
		e_wsfe();
		s_stop("777", 3L);
	    }
	    rho[j - 1] = h__;
	    g = rho[k2 - 1] - a[k + j * 600] * b[k];
	    rho[k2 - 1] = g;
	    pivt = g * g / h__;
	    if (pivt < piv) {
		goto L80;
	    }
	    kpiv = j;
	    piv = pivt;
L80:
	    ++k2;
	}
 
L90:
	x[k] = b[k] / rho[*n + k - 1];
	if (k == 1) {
	    goto L120;
	}
	i__2 = k;
	for (i__ = 2; i__ <= i__2; ++i__) {
	    kk = k - i__ + 1;
	    x[kk] = b[kk];
	    ki = kk + 1;
	    i__3 = k;
	    for (j = ki; j <= i__3; ++j) {
 
		x[kk] -= a[kk + j * 600] * x[j];
	    }
	    x[kk] /= rho[*n + kk - 1];
 
	}
L120:
 

	i__2 = *m;
	for (iii = 1; iii <= i__2; ++iii) {
 
	    r__[iii] = b[iii];
	}
	i__2 = k;
	for (iii = 1; iii <= i__2; ++iii) {
 
	    x[iii] = -x[iii];
	}
 
 
 
	htrl_(&a[601], &r__[1], m, n, &k, rho);
	calrms_(&r__[1], m, &rmss[k - 1], &ptop[k - 1]);
	xiter[k] = (doublereal) k;
	xrms[k] = rmss[k - 1];
	xptp[k] = ptop[k - 1];
	if (ptop[k - 1] <= *ptp) {
	    goto L160;
	}
	if (rmss[k - 1] <= *rms) {
	    goto L160;
	}
 
    }
    return 0;
 
 
L160:
    *ptp = ptop[k - 1];
    *rms = rmss[k - 1];
}  

 
  int htrl_(a, b, m, n, k, rho)
doublereal *a, *b;
integer *m, *n, *k;
doublereal *rho;
{
     
    integer i__1;

     
    static integer i__, kk, kl, kn, lv;
    static doublereal beta;
    extern   int htbl_();

 

 
 
 
 
 

 
     
    --rho;
    --b;
    a -= 601;

     
    i__1 = *k;
    for (i__ = 1; i__ <= i__1; ++i__) {
	b[i__] = 0.;
 
    }
    i__1 = *k;
    for (kk = 1; kk <= i__1; ++kk) {
	lv = *m - *k + kk;
	kn = *n + *k - kk + 1;
	kl = *k - kk + 1;
	beta = -1. / (rho[kn] * a[kl + kl * 600]);
	htbl_(&a[601], &b[1], m, n, &kl, &beta);
 
    }
}  

 
  int htul_(a, m, n, k, sig, beta)
doublereal *a;
integer *m, *n, *k;
doublereal *sig, *beta;
{
     
    integer i__1;

     
    double sqrt();

     
    static doublereal h__;
    static integer i__;

 

 
 
 
 
 

 
     
    a -= 601;

     
    *sig = 0.;
    i__1 = *m;
    for (i__ = *k; i__ <= i__1; ++i__) {
	*sig += a[i__ + *k * 600] * a[i__ + *k * 600];
 
    }
    *sig = sqrt(*sig);
 
    h__ = a[*k + *k * 600];
    if (h__ < 0.) {
	*sig = -(*sig);
    }
    *beta = h__ + *sig;
    a[*k + *k * 600] = *beta;
    *beta = 1. / (*sig * *beta);
}  

 
  int hyper6_(a, ch, sh)
doublereal *a, *ch, *sh;
{
     
    double exp();

     
    static doublereal x, xi;

    x = exp(*a);
    xi = 1. / x;
    *ch = (x + xi) / 2.;
    *sh = (x - xi) / 2.;
    return 0;
}  

  int igmeta_(i__, j)
integer *i__, *j;
{
    return 0;
}  

 
  int intd6_(v, h__, x)
integer *v, *h__, *x;
{
     

    static integer b1 = 0;
    static integer b2 = 0;
    static integer b3 = 0;
    static integer b4 = 0;

    static integer i__;
    extern doublereal dlie6_();
    extern   int daadd_(), dadal_(), daall_(), dacfu_(), 
	    dacon_(), dacop_(), dasub_(), damul_();

 

 


     
    --x;
    --v;

     

    daall_(&v[1], &c__12, "V         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&x[1], &c__12, "X         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(h__, &c__1, "H         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&b1, &c__1, "B1        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&b2, &c__1, "B2        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&b3, &c__1, "B3        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&b4, &c__1, "B4        ", & ii_ .no, & ii_ .nv, 10L);
 
    dacon_(&b4, &c_b251);
    dacon_(h__, &c_b251);
    for (i__ = 1; i__ <= 3; ++i__) {
	dacfu_(&v[(i__ << 1) - 1], dlie6_, &b3);
	dacfu_(&v[i__ * 2], dlie6_, &b1);
	damul_(&b1, &x[(i__ << 1) - 1], &b2);
	damul_(&b3, &x[i__ * 2], &b1);
	dasub_(&b2, &b1, &b3);
	daadd_(&b3, &b4, &b2);
	dacop_(&b2, &b4);
 
    }
    dacop_(&b4, h__);
    dadal_(&b4, &c__1);
    dadal_(&b3, &c__1);
    dadal_(&b2, &c__1);
    dadal_(&b1, &c__1);
    return 0;
}  

 
 
  int intepr_(i__, j, ch, ch1, ch_len, ch1_len)
integer *i__, *j;
char *ch, *ch1;
ftnlen ch_len;
ftnlen ch1_len;
{
     
    static char fmt_1000[] = "(a160)";

     
    address a__1[3], a__2[5], a__3[2];
    integer i__1[3], i__2[5], i__3[2];
    alist al__1;

     
    integer s_cmp();
      int s_copy(), s_cat();
    integer f_rew(), s_wsfe(), do_fio(), e_wsfe();

     
    static integer i0, i1, i2, i3, i4, ii, iev, ierro;
    extern   int error_();

     
    static cilist io___2543 = { 1, 11, 0, fmt_1000, 0 };


 

 

 

 
 
 
 
 
 
 
 
 

 
 
 
 

    i0 = 0;
    i1 = *j;
    i2 = 1;
    i4 = 0;
    for (ii = *j; ii <= 80; ++ii) {
	if (i0 == 0 && *(unsigned char *)&ch[ii - 1] == ' ') {
	    if (*i__ == 2 && ii == 5 && s_cmp(ch, "     ", 5L, 5L) == 0) {
		s_copy(ch1, "' ' ", 4L, 4L);
		i2 = 5;
	    }
	    i1 = ii + 1;
	    goto L10;
	}
	i0 = 1;
	if (*(unsigned char *)&ch[ii - 1] == ' ') {
	    ++i4;
	    iev = 1;
	    if (i4 % 2 == 0) {
		iev = 0;
	    }
	    if (*i__ == 1) {
		goto L20;
	    }
	    if (*i__ == 2 || *i__ == 3 || *i__ == 4 || *i__ == 5 && (real) 
		    iev == (float)1. || *i__ == 6 && i4 >= 2 || *i__ == 7 && (
		    i4 == 2 || i4 == 3) || *i__ == 8 && i4 < 3) {
		i3 = i2 + ii - i1 + 2;
 
		i__1[0] = 1, a__1[0] = "'";
		i__1[1] = ii - 1 - (i1 - 1), a__1[1] = ch + (i1 - 1);
		i__1[2] = 2, a__1[2] = "' ";
		s_cat(ch1 + (i2 - 1), a__1, i__1, &c__3, i3 - (i2 - 1));
		if (*i__ == 4 && i4 == 2) {
		    goto L30;
		}
		i2 = i3 + 1;
	    }
	    if (*i__ == 5 && iev == 0 || i4 == 1 && (*i__ == 6 || *i__ == 7)) 
		    {
		i3 = i2 + ii - i1;
		s_copy(ch1 + (i2 - 1), ch + (i1 - 1), i3 - (i2 - 1), ii - (i1 
			- 1));
		i2 = i3 + 1;
	    }
	    if (*i__ == 7 && i4 > 3 || *i__ == 8 && i4 == 3) {
		goto L40;
	    }
	    i0 = 0;
	    i1 = ii + 1;
	}
L10:
	;
    }
    goto L30;
L20:
 
    i__2[0] = 1, a__2[0] = "'";
    i__2[1] = ii - 1 - (i1 - 1), a__2[1] = ch + (i1 - 1);
    i__2[2] = 1, a__2[2] = "'";
    i__2[3] = 80 - (ii - 1), a__2[3] = ch + (ii - 1);
    i__2[4] = 3, a__2[4] = " / ";
    s_cat(ch1, a__2, i__2, &c__5, 85L);
    goto L50;
L30:
    ++i3;
    s_copy(ch1 + (i3 - 1), " / ", 3L, 3L);
    goto L50;
L40:
    i3 = i2 + 83 - i1;
 
    i__3[0] = 80 - (i1 - 1), a__3[0] = ch + (i1 - 1);
    i__3[1] = 3, a__3[1] = " / ";
    s_cat(ch1 + (i2 - 1), a__3, i__3, &c__2, i3 - (i2 - 1));
L50:
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    ierro = s_wsfe(&io___2543);
    if (ierro != 0) {
	goto L100090;
    }
    ierro = do_fio(&c__1, ch1, 160L);
    if (ierro != 0) {
	goto L100090;
    }
    ierro = e_wsfe();
L100090:
    if (ierro != 0) {
	error_(&c__59);
    }
    al__1.aerr = 0;
    al__1.aunit = 11;
    f_rew(&al__1);
    return 0;
}  

 
 
  int join_()
{
     
    static char fmt_10010[] = "(//10x,\002** ERROR IN JOIN** ----- PROBLEMS WITH DATA \002,\002FILE : \002,i2,\002 ----- ERROR CODE : \002,i10//)";
    static char fmt_10000[] = "(//10x,\002** ERROR IN JOIN** ----- INPUT DATA EMPTY\002,\002 (FILE : \002,i2,\002) -----\002//)";

     
    integer i__1, i__2, i__3;
    cllist cl__1;
    alist al__1;

     
    double atan();
    integer s_rsue(), do_uio(), e_rsue(), s_wsfe(), do_fio(), e_wsfe(), f_rew(
	    ), s_wsue(), e_wsue(), f_clos();
      int s_copy();

     
    static integer i__;
    static doublereal x[12]	 , y[12]	 , e0;
    static integer ia;
    static doublereal ta[36]	 , pi, di0[2], dam;
    static integer ipa;
    static doublereal clo[3], dps[6], qwc[3], alf0[2], bet0[2], dip0[2];
    static integer ipa1;
    static doublereal clop[3], sigm[6];
    static integer numl;
    static char cdate[8];
    static integer ihalf, ilapa, ifipa;
    static char ctime[8];
    static integer itopa, ierro;
    static doublereal dummy;
    static char commen[80];
    static integer idummy;
    static char progrm[8], sixtit[80];

     
    static cilist io___2546 = { 1, 90, 1, 0, 0 };
    static cilist io___2563 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___2568 = { 1, 0, 1, 0, 0 };
    static cilist io___2569 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___2570 = { 1, 0, 1, 0, 0 };
    static cilist io___2571 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___2572 = { 1, 0, 1, 0, 0 };
    static cilist io___2580 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___2581 = { 1, 0, 1, 0, 0 };
    static cilist io___2583 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___2584 = { 1, 90, 0, 0, 0 };
    static cilist io___2586 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___2587 = { 1, 0, 0, 0, 0 };
    static cilist io___2588 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___2589 = { 1, 0, 1, 0, 0 };
    static cilist io___2590 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___2591 = { 1, 0, 0, 0, 0 };
    static cilist io___2592 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___2593 = { 1, 90, 1, 0, 0 };
    static cilist io___2595 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___2596 = { 1, 0, 0, 0, 0 };
    static cilist io___2597 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___2598 = { 0, 6, 0, fmt_10000, 0 };


 

 

    pi = atan(1.) * 4.;
    cor_ .sigcor = 1.;
    cor_ .dpscor = 1.;
    ierro = s_rsue(&io___2546);
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, sixtit, 80L);
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, commen, 80L);
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, cdate, 8L);
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, ctime, 8L);
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, progrm, 8L);
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ifipa, (ftnlen)sizeof(integer));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ilapa, (ftnlen)sizeof(integer));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&itopa, (ftnlen)sizeof(integer));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)& cor_ .icode, (ftnlen)sizeof(integer));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&numl, (ftnlen)sizeof(integer));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&qwc[0], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&qwc[1], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&qwc[2], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&clo[0], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&clop[0], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&clo[1], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&clop[1], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&clo[2], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&clop[2], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&di0[0], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&dip0[0], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&di0[1], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&dip0[1], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&dummy, (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&dummy, (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[0], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[6], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[12], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[18], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[24], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[30], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[1], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[7], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[13], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[19], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[25], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[31], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[2], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[8], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[14], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[20], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[26], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[32], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[3], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[9], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[15], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[21], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[27], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[33], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[4], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[10], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[16], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[22], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[28], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[34], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[5], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[11], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[17], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[23], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[29], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = do_uio(&c__1, (char *)&ta[35], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100091;
    }
    ierro = e_rsue();
L100091:
    if (ierro < 0) {
	goto L60;
    }
    if (ierro > 0) {
	s_wsfe(&io___2563);
	do_fio(&c__1, (char *)&c__90, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)&ierro, (ftnlen)sizeof(integer));
	e_wsfe();
	goto L70;
    }
 

 
 

    bet0[0] = ta[0] * ta[0] + ta[6] * ta[6];
    alf0[0] = -(ta[0] * ta[1] + ta[6] * ta[7]);
    bet0[1] = ta[14] * ta[14] + ta[20] * ta[20];
    alf0[1] = -(ta[14] * ta[15] + ta[20] * ta[21]);
    al__1.aerr = 0;
    al__1.aunit = 90;
    f_rew(&al__1);
    ihalf = itopa / 2;
    if (cor_ .icode == 1 || cor_ .icode == 2 || cor_ .icode == 4) {
	cor_ .idam = 1;
    }
    if (cor_ .icode == 3 || cor_ .icode == 5 || cor_ .icode == 6) {
	cor_ .idam = 2;
    }
    if (cor_ .icode == 7) {
	cor_ .idam = 3;
    }
    i__1 = ihalf;
    for (i__ = 1; i__ <= i__1; ++i__) {
	io___2568.ciunit = 91 - i__;
	ierro = s_rsue(&io___2568);
	if (ierro != 0) {
	    goto L100092;
	}
	ierro = e_rsue();
L100092:
	if (ierro < 0) {
	    goto L50;
	}
	if (ierro > 0) {
	    s_wsfe(&io___2569);
	    i__2 = 91 - i__;
	    do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&ierro, (ftnlen)sizeof(integer));
	    e_wsfe();
	    goto L50;
	}
	io___2570.ciunit = 91 - i__ - ihalf;
	ierro = s_rsue(&io___2570);
	if (ierro != 0) {
	    goto L100093;
	}
	ierro = e_rsue();
L100093:
	if (ierro < 0) {
	    goto L50;
	}
	if (ierro > 0) {
	    s_wsfe(&io___2571);
	    i__2 = 91 - i__ - ihalf;
	    do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&ierro, (ftnlen)sizeof(integer));
	    e_wsfe();
	    goto L50;
	}
L10:
	io___2572.ciunit = 91 - i__;
	ierro = s_rsue(&io___2572);
	if (ierro != 0) {
	    goto L100094;
	}
	ierro = do_uio(&c__1, (char *)&ia, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100094;
	}
	ierro = do_uio(&c__1, (char *)&ipa, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100094;
	}
	ierro = do_uio(&c__1, (char *)&dummy, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100094;
	}
	ierro = do_uio(&c__1, (char *)&x[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100094;
	}
	ierro = do_uio(&c__1, (char *)&y[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100094;
	}
	ierro = do_uio(&c__1, (char *)&x[6], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100094;
	}
	ierro = do_uio(&c__1, (char *)&y[6], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100094;
	}
	ierro = do_uio(&c__1, (char *)&sigm[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100094;
	}
	ierro = do_uio(&c__1, (char *)&dps[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100094;
	}
	ierro = do_uio(&c__1, (char *)&e0, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100094;
	}
	ierro = e_rsue();
L100094:
	if (ierro < 0) {
	    goto L20;
	}
	if (ierro > 0) {
	    s_wsfe(&io___2580);
	    i__2 = 91 - i__;
	    do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&ierro, (ftnlen)sizeof(integer));
	    e_wsfe();
	    goto L20;
	}
	x[0] *= 1e3;
	y[0] *= 1e3;
	x[6] *= 1e3;
	y[6] *= 1e3;
	sigm[0] *= 1e3;
	e0 *= 1e3;
	io___2581.ciunit = 91 - i__ - ihalf;
	ierro = s_rsue(&io___2581);
	if (ierro != 0) {
	    goto L100095;
	}
	ierro = do_uio(&c__1, (char *)&idummy, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100095;
	}
	ierro = do_uio(&c__1, (char *)&idummy, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100095;
	}
	ierro = do_uio(&c__1, (char *)&dummy, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100095;
	}
	ierro = do_uio(&c__1, (char *)&x[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100095;
	}
	ierro = do_uio(&c__1, (char *)&y[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100095;
	}
	ierro = do_uio(&c__1, (char *)&x[7], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100095;
	}
	ierro = do_uio(&c__1, (char *)&y[7], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100095;
	}
	ierro = do_uio(&c__1, (char *)&sigm[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100095;
	}
	ierro = do_uio(&c__1, (char *)&dps[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100095;
	}
	ierro = e_rsue();
L100095:
	if (ierro < 0) {
	    goto L20;
	}
	if (ierro > 0) {
	    s_wsfe(&io___2583);
	    i__2 = 91 - i__ - ihalf;
	    do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&ierro, (ftnlen)sizeof(integer));
	    e_wsfe();
	    goto L20;
	}
	x[1] *= 1e3;
	y[1] *= 1e3;
	x[7] *= 1e3;
	y[7] *= 1e3;
	sigm[1] *= 1e3;
	ierro = s_wsue(&io___2584);
	if (ierro != 0) {
	    goto L100096;
	}
	ierro = do_uio(&c__1, (char *)&ia, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100096;
	}
	ierro = do_uio(&c__1, (char *)&ipa, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100096;
	}
	ierro = do_uio(&c__1, (char *)&dummy, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100096;
	}
	ierro = do_uio(&c__1, (char *)&x[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100096;
	}
	ierro = do_uio(&c__1, (char *)&y[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100096;
	}
	ierro = do_uio(&c__1, (char *)&x[6], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100096;
	}
	ierro = do_uio(&c__1, (char *)&y[6], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100096;
	}
	ierro = do_uio(&c__1, (char *)&sigm[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100096;
	}
	ierro = do_uio(&c__1, (char *)&dps[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100096;
	}
	ierro = do_uio(&c__1, (char *)&e0, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100096;
	}
	i__2 = ipa + 1;
	ierro = do_uio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100096;
	}
	ierro = do_uio(&c__1, (char *)&dam, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100096;
	}
	ierro = do_uio(&c__1, (char *)&x[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100096;
	}
	ierro = do_uio(&c__1, (char *)&y[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100096;
	}
	ierro = do_uio(&c__1, (char *)&x[7], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100096;
	}
	ierro = do_uio(&c__1, (char *)&y[7], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100096;
	}
	ierro = do_uio(&c__1, (char *)&sigm[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100096;
	}
	ierro = do_uio(&c__1, (char *)&dps[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100096;
	}
	ierro = do_uio(&c__1, (char *)&e0, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100096;
	}
	ierro = e_wsue();
L100096:
	if (ierro != 0) {
	    s_wsfe(&io___2586);
	    do_fio(&c__1, (char *)&c__90, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&ierro, (ftnlen)sizeof(integer));
	    e_wsfe();
	    goto L20;
	}
	goto L10;
L20:
	al__1.aerr = 0;
	al__1.aunit = 91 - i__;
	f_rew(&al__1);
	al__1.aerr = 0;
	al__1.aunit = 91 - i__ - ihalf;
	f_rew(&al__1);
	io___2587.ciunit = 91 - i__ - ihalf;
	ierro = s_wsue(&io___2587);
	if (ierro != 0) {
	    goto L100097;
	}
	ierro = e_wsue();
L100097:
	if (ierro != 0) {
	    s_wsfe(&io___2588);
	    i__2 = 91 - i__ - ihalf;
	    do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&ierro, (ftnlen)sizeof(integer));
	    e_wsfe();
	}
	cl__1.cerr = 0;
	cl__1.cunit = 91 - i__ - ihalf;
	cl__1.csta = 0;
	f_clos(&cl__1);
	al__1.aerr = 0;
	al__1.aunit = 90;
	f_rew(&al__1);
	io___2589.ciunit = 91 - i__;
	ierro = s_rsue(&io___2589);
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, sixtit, 80L);
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, commen, 80L);
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, cdate, 8L);
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, ctime, 8L);
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, progrm, 8L);
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ifipa, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ilapa, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&itopa, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)& cor_ .icode, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&numl, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&qwc[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&qwc[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&qwc[2], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&clo[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&clop[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&clo[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&clop[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&clo[2], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&clop[2], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&di0[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&dip0[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&di0[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&dip0[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&dummy, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&dummy, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[6], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[12], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[18], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[24], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[30], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[7], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[13], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[19], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[25], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[31], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[2], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[8], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[14], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[20], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[26], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[32], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[3], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[9], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[15], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[21], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[27], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[33], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[4], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[10], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[16], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[22], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[28], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[34], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[5], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[11], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[17], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[23], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[29], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = do_uio(&c__1, (char *)&ta[35], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100098;
	}
	ierro = e_rsue();
L100098:
	if (ierro > 0) {
	    s_wsfe(&io___2590);
	    i__2 = 91 - i__;
	    do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&ierro, (ftnlen)sizeof(integer));
	    e_wsfe();
	    goto L40;
	}
	al__1.aerr = 0;
	al__1.aunit = 91 - i__;
	f_rew(&al__1);
	s_copy(progrm, "MADTOSIX", 8L, 8L);
	io___2591.ciunit = 91 - i__;
	ierro = s_wsue(&io___2591);
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, sixtit, 80L);
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, commen, 80L);
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, cdate, 8L);
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, ctime, 8L);
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, progrm, 8L);
	if (ierro != 0) {
	    goto L100099;
	}
	i__2 = (i__ << 1) - 1;
	ierro = do_uio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100099;
	}
	i__3 = i__ << 1;
	ierro = do_uio(&c__1, (char *)&i__3, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&itopa, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)& cor_ .icode, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&numl, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&qwc[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&qwc[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&qwc[2], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&clo[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&clop[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&clo[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&clop[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&clo[2], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&clop[2], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&di0[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&dip0[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&di0[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&dip0[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&dummy, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&dummy, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[6], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[12], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[18], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[24], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[30], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[7], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[13], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[19], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[25], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[31], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[2], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[8], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[14], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[20], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[26], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[32], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[3], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[9], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[15], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[21], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[27], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[33], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[4], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[10], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[16], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[22], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[28], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[34], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[5], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[11], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[17], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[23], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[29], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&ta[35], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)& cor_ .sigcor, (ftnlen)sizeof(
		doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)& cor_ .dpscor, (ftnlen)sizeof(
		doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100099;
	}
	ierro = e_wsue();
L100099:
	if (ierro != 0) {
	    s_wsfe(&io___2592);
	    i__2 = 91 - i__;
	    do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&ierro, (ftnlen)sizeof(integer));
	    e_wsfe();
	    goto L40;
	}
L30:
	ierro = s_rsue(&io___2593);
	if (ierro != 0) {
	    goto L100100;
	}
	ierro = do_uio(&c__1, (char *)&ia, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100100;
	}
	ierro = do_uio(&c__1, (char *)&ipa, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100100;
	}
	ierro = do_uio(&c__1, (char *)&dam, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100100;
	}
	ierro = do_uio(&c__1, (char *)&x[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100100;
	}
	ierro = do_uio(&c__1, (char *)&y[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100100;
	}
	ierro = do_uio(&c__1, (char *)&x[6], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100100;
	}
	ierro = do_uio(&c__1, (char *)&y[6], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100100;
	}
	ierro = do_uio(&c__1, (char *)&sigm[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100100;
	}
	ierro = do_uio(&c__1, (char *)&dps[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100100;
	}
	ierro = do_uio(&c__1, (char *)&e0, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100100;
	}
	ierro = do_uio(&c__1, (char *)&ipa1, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100100;
	}
	ierro = do_uio(&c__1, (char *)&dam, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100100;
	}
	ierro = do_uio(&c__1, (char *)&x[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100100;
	}
	ierro = do_uio(&c__1, (char *)&y[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100100;
	}
	ierro = do_uio(&c__1, (char *)&x[7], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100100;
	}
	ierro = do_uio(&c__1, (char *)&y[7], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100100;
	}
	ierro = do_uio(&c__1, (char *)&sigm[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100100;
	}
	ierro = do_uio(&c__1, (char *)&dps[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100100;
	}
	ierro = do_uio(&c__1, (char *)&e0, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100100;
	}
	ierro = e_rsue();
L100100:
	if (ierro < 0) {
	    goto L40;
	}
	if (ierro > 0) {
	    s_wsfe(&io___2595);
	    do_fio(&c__1, (char *)&c__90, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&ierro, (ftnlen)sizeof(integer));
	    e_wsfe();
	    goto L40;
	}
	io___2596.ciunit = 91 - i__;
	ierro = s_wsue(&io___2596);
	if (ierro != 0) {
	    goto L100101;
	}
	ierro = do_uio(&c__1, (char *)&ia, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100101;
	}
	ierro = do_uio(&c__1, (char *)&ipa, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100101;
	}
	ierro = do_uio(&c__1, (char *)&dam, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100101;
	}
	ierro = do_uio(&c__1, (char *)&x[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100101;
	}
	ierro = do_uio(&c__1, (char *)&y[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100101;
	}
	ierro = do_uio(&c__1, (char *)&x[6], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100101;
	}
	ierro = do_uio(&c__1, (char *)&y[6], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100101;
	}
	ierro = do_uio(&c__1, (char *)&sigm[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100101;
	}
	ierro = do_uio(&c__1, (char *)&dps[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100101;
	}
	ierro = do_uio(&c__1, (char *)&e0, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100101;
	}
	ierro = do_uio(&c__1, (char *)&ipa1, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100101;
	}
	ierro = do_uio(&c__1, (char *)&dam, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100101;
	}
	ierro = do_uio(&c__1, (char *)&x[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100101;
	}
	ierro = do_uio(&c__1, (char *)&y[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100101;
	}
	ierro = do_uio(&c__1, (char *)&x[7], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100101;
	}
	ierro = do_uio(&c__1, (char *)&y[7], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100101;
	}
	ierro = do_uio(&c__1, (char *)&sigm[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100101;
	}
	ierro = do_uio(&c__1, (char *)&dps[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100101;
	}
	ierro = do_uio(&c__1, (char *)&e0, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100101;
	}
	ierro = e_wsue();
L100101:
	if (ierro != 0) {
	    s_wsfe(&io___2597);
	    i__2 = 91 - i__;
	    do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&ierro, (ftnlen)sizeof(integer));
	    e_wsfe();
	    goto L40;
	}
	goto L30;
L40:
	al__1.aerr = 0;
	al__1.aunit = 90;
	f_rew(&al__1);
	al__1.aerr = 0;
	al__1.aunit = 91 - i__;
	f_rew(&al__1);
L50:
	;
    }
    cl__1.cerr = 0;
    cl__1.cunit = 90;
    cl__1.csta = 0;
    f_clos(&cl__1);
    goto L70;
L60:
    s_wsfe(&io___2598);
    do_fio(&c__1, (char *)&c__90, (ftnlen)sizeof(integer));
    e_wsfe();
L70:
 

    return 0;
}  

 
  int lie6_(h__, x, y, m, non)
integer *h__, *x, *y, *m, *non;
{
     

    static integer b1 = 0;
    static integer b2 = 0;
    static integer b3 = 0;
    static integer b4 = 0;

     
    integer i__1;

     
    static integer i__;
    static doublereal coe;
    static integer max__;
    extern   int daadd_(), dadal_(), daall_(), dacop_(), 
	    dacmu_(), dapoi_();

 

 



    daall_(h__, &c__1, "H         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(x, &c__1, "X         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(y, &c__1, "Y         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&b1, &c__1, "B1        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&b2, &c__1, "B2        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&b3, &c__1, "B3        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&b4, &c__1, "B4        ", & ii_ .no, & ii_ .nv, 10L);
 
    max__ = (integer) ((doublereal) (*non - 2) / (doublereal) (*m - 2) + 
	    1e-10);
    dacop_(x, &b4);
    dacop_(x, &b1);
    i__1 = max__;
    for (i__ = 1; i__ <= i__1; ++i__) {
	coe = 1. / i__;
	dacmu_(&b1, &coe, &b2);
	dapoi_(h__, &b2, &b1, &c__3);
	daadd_(&b4, &b1, &b3);
	dacop_(&b3, &b4);
 
    }
    dacop_(&b3, y);
    dadal_(&b4, &c__1);
    dadal_(&b3, &c__1);
    dadal_(&b2, &c__1);
    dadal_(&b1, &c__1);
    return 0;
}  

 
 
  int linopt_(dpp)
doublereal *dpp;
{
     

    static doublereal dpr[6] = { 0.,0.,0.,0.,0.,0. };

     
    static char fmt_10010[] = "(132(\002-\002))";
    static char fmt_10000[] = "(t5,\002---- ENTRY LINOPT ----\002)";
    static char fmt_10050[] = "(t8,\002  PLANE          DISP(MM)                 DISP(MRAD)\002/t6,\002      X  \002,2(f20.12,6x)/t10,\002  Z  \002,2(f20.12,6x)/)";
    static char fmt_10040[] = "(\002 \002/10x,\002RELATIVE ENERGY DEVIATION  \002,t40,f10.7/10x,\002TUNES -HORIZONTAL\002,t40,f10.7/10x,\002      -VERTICAL  \002,t40,f10.7/)";
    static char fmt_10030[] = "(\002 \002,\002  LINEAR OPTICS CALCULATION WITH PRINTOUT \002,\002AFTER EACH BLOCK\002/\002   A T T E N T I O N : BETATRON PHASE CALCULATION MIGHT BE WRONG\002,\002 BY A MULTIPLE OF 0.5 FOR EACH LARGE BLOCK\002/)";
    static char fmt_10020[] = "(\002 \002,\002  NR     TYP      L-TOTAL    P     PHI          \002,\002BETA         ALFA         GAMMA        DIS        DISP         \002,\002CLO        CLOP\002/1x,\002                    (M)           (2*PI)        \002,\002(M)          (RAD)         (M)         (M)        (RAD)        \002,\002(MM)       (MRAD)\002)";
    static char fmt_10060[] = "(//131(\002-\002)//)";

     
    integer i__1, i__2, i__3;
    doublereal d__1;

     
    integer s_wsfe(), e_wsfe(), do_fio();
      int s_copy();
    double atan();

     
    extern   int envardis_(), writelin_();
    static integer i__, j, k, l;
    static doublereal t[24]	 ;
    static integer l1;
    static doublereal r0, aa[11], bb[11];
    static integer dj;
    static doublereal cr[11], ci[11];
    static integer nr, ll;
    static doublereal qw[2];
    static integer ix, jj, jm, jk;
    static doublereal qu, qv, xs, zs, xl, zl;
    static integer im;
    static doublereal r0a, qu1, alfa[2], phi[2], clo0[2];
    static char idum[16];
    static doublereal beta[2], clop0[2], di00[2], dip00[2], qwc[3], aeg[8400]	
	     , bl1eg[3600]	 , bl2eg[
	    3600]	 , phibf[2];
    static integer ium;
    static doublereal pie, etl, dpp1;
    extern   int clorb_();
    static integer iflag;
    extern   int envar_(), error_();
    static integer izu;
    static doublereal dphi, puf, dyy1, dyy2;
    static integer kpz, kzz;
    static doublereal ekk, crkve, cikve, dppi;
    static integer nmz;
    static doublereal benkr, dyy11;
    extern   int betalf_(), phasad_();
    static doublereal tiltck, tiltsk, crkveuk;
    extern   int cpltwis_();

     
    static cilist io___2609 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___2610 = { 0, 6, 0, fmt_10000, 0 };
    static cilist io___2633 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___2634 = { 0, 6, 0, fmt_10050, 0 };
    static cilist io___2635 = { 0, 6, 0, fmt_10040, 0 };
    static cilist io___2639 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___2640 = { 0, 6, 0, fmt_10030, 0 };
    static cilist io___2641 = { 0, 6, 0, fmt_10020, 0 };
    static cilist io___2642 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___2679 = { 0, 6, 0, fmt_10060, 0 };


 

 
 

 

    cororb_ .nhmoni = 0;
    cororb_ .nvmoni = 0;
    cororb_ .nhcorr = 0;
    cororb_ .nvcorr = 0;
    ium = 6;
    pie = kons_ .pi * 2.;
    if (clos_ .ncorru == 0) {
	s_wsfe(&io___2609);
	e_wsfe();
	s_wsfe(&io___2610);
	e_wsfe();
    }
    i__1 = ium;
    for (i__ = 1; i__ <= i__1; ++i__) {
	dpr[i__ - 1] = 0.;
 
    }
    i__1 = ium;
    for (i__ = 1; i__ <= i__1; ++i__) {
	for (j = 1; j <= 4; ++j) {
	    t[i__ + j * 6 - 7] = 0.;
 
	}
    }
    for (i__ = 1; i__ <= 2; ++i__) {
	beta[i__ - 1] = 0.;
	alfa[i__ - 1] = 0.;
	phibf[i__ - 1] = 0.;
	phi[i__ - 1] = 0.;
	clo0[i__ - 1] = 0.;
	clop0[i__ - 1] = 0.;
	di00[i__ - 1] = 0.;
	dip00[i__ - 1] = 0.;
	qw[i__ - 1] = 0.;
	qwc[i__ - 1] = 0.;
 
    }
    qwc[2] = 0.;
    for (i__ = 1; i__ <= 11; ++i__) {
	aa[i__ - 1] = 0.;
	bb[i__ - 1] = 0.;
	cr[i__ - 1] = 0.;
	ci[i__ - 1] = 0.;
 
    }
    etl = 0.;
    nr = 0;
    dpr[0] = *dpp * 1e3;
    dpr[5] = 1e3;
    dpp1 = *dpp + clo_ .ded;
    clorb_(&dpp1);
    for (l = 1; l <= 2; ++l) {
	clo0[l - 1] = (tra_._1) .clo[l - 1];
 
	clop0[l - 1] = (tra_._1) .clop[l - 1];
    }
    clorb_(dpp);
    for (l = 1; l <= 2; ++l) {
	ll = l << 1;
	beo_ .di0[l - 1] = (clo0[l - 1] - (tra_._1) .clo[l - 1]) / clo_ .ded;
	beo_ .dip0[l - 1] = (clop0[l - 1] - (tra_._1) .clop[l - 1]) / clo_ .ded;
	t[(ll - 1) * 6 - 1] = beo_ .di0[l - 1];
 
	t[ll * 6 - 1] = beo_ .dip0[l - 1];
    }
    if (clos_ .ncorru == 0) {
	s_wsfe(&io___2633);
	e_wsfe();
	s_wsfe(&io___2634);
	for (l = 1; l <= 2; ++l) {
	    do_fio(&c__1, (char *)& beo_ .di0[l - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& beo_ .dip0[l - 1], (ftnlen)sizeof(
		    doublereal));
	}
	e_wsfe();
    }
    betalf_(dpp, qw);
    phasad_(dpp, qwc);
    if (erro_ .ierro != 0) {
	i__1 = erro_ .ierro + 22;
	error_(&i__1);
    }
    if (clos_ .ncorru == 0) {
	s_wsfe(&io___2635);
	do_fio(&c__1, (char *)&(*dpp), (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&qwc[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&qwc[1], (ftnlen)sizeof(doublereal));
	e_wsfe();
    }
    envar_(dpp);
    if (tit_ .ithick == 1) {
	envardis_(&dpp1, aeg, bl1eg, bl2eg);
    }
 
    for (l = 1; l <= 2; ++l) {
	ll = l << 1;
	t[(ll - 1) * 6 - 6] = (tra_._1) .clo[l - 1];
 
	t[ll * 6 - 6] = (tra_._1) .clop[l - 1];
    }
    for (i__ = 1; i__ <= 4; ++i__) {
	for (j = 1; j <= 4; ++j) {
	    t[i__ + 1 + j * 6 - 7] = beo_ .ta[j + i__ * 6 - 7];
 
	    t[i__ + 1 + j * 6 - 7] = beo_ .ta[j + i__ * 6 - 7];
	}
    }
    if (clos_ .ncorru == 0) {
	s_wsfe(&io___2639);
	e_wsfe();
	if (linop_ .iprint != 0) {
	    s_wsfe(&io___2640);
	    e_wsfe();
	}
	s_wsfe(&io___2641);
	e_wsfe();
	s_wsfe(&io___2642);
	e_wsfe();
    }
    iflag = 0;
    s_copy(idum, "START", 16L, 5L);
    writelin_(&nr, idum, &etl, phi, t, &ix, 16L);
    if (linop_ .ntco != 0 && nr % linop_ .ntco == 0) {
	cpltwis_(idum, t, &etl, phi, 16L);
    }
 
    if (linop_ .nt <= 0 || linop_ .nt > str_ .iu) {
	linop_ .nt = str_ .iu;
    }
    izu = 0;
    i__1 = linop_ .nt;
    for (k = 1; k <= i__1; ++k) {
	ix = str_ .ic[k - 1];
	if (ix > 300) {
	    goto L220;
	}
	if (tit_ .ithick == 1 && linop_ .iprint != 0) {
	    goto L160;
	}
	jj = 0;
	dj = 1;
	if (ix > 0) {
	    goto L90;
	}
	ix = -ix;
	jj = str2_ .mel[ix - 1] + 1;
	dj = -1;
L90:
	jm = str2_ .mel[ix - 1];
 
	i__2 = jm;
	for (j = 1; j <= i__2; ++j) {
	    jj += dj;
	    jk = str2_ .mtyp[ix + jj * 300 - 301];
	    if (tit_ .ithick == 1 && ell_ .kz[jk - 1] != 0) {
		goto L120;
	    }
	    if (tit_ .ithick == 0 && ell_ .kz[jk - 1] != 0) {
		goto L500;
	    }
 
	    etl += ell_ .el[jk - 1];
	    for (l = 1; l <= 2; ++l) {
		ll = l << 1;
		if ((d__1 = t[ll + (ll - 1) * 6 - 7], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		    phibf[l - 1] = atan(t[ll + 1 + (ll - 1) * 6 - 7] / t[ll + 
			    (ll - 1) * 6 - 7]);
		} else {
		    phibf[l - 1] = kons_ .pi2;
		}
		i__3 = ium;
		for (i__ = 1; i__ <= i__3; ++i__) {
 
		    t[i__ + (ll - 1) * 6 - 7] += t[i__ + ll * 6 - 7] * 
			    ell_ .el[jk - 1];
		}
	    }
	    for (l = 1; l <= 2; ++l) {
		ll = l << 1;
		if ((d__1 = t[ll + (ll - 1) * 6 - 7], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		    dphi = atan(t[ll + 1 + (ll - 1) * 6 - 7] / t[ll + (ll - 1)
			     * 6 - 7]) - phibf[l - 1];
		} else {
		    dphi = kons_ .pi2 - phibf[l - 1];
		}
		if (-dphi > 1e-17) {
		    dphi += kons_ .pi;
		}
 
		phi[l - 1] += dphi / pie;
	    }
	    ++nr;
	    writelin_(&nr, linopc_ .bez + (jk - 1 << 4), &etl, phi, t, &ix, 
		    16L);
	    if (linop_ .ntco != 0 && nr % linop_ .ntco == 0) {
		cpltwis_(linopc_ .bez + (jk - 1 << 4), t, &etl, phi, 16L);
	    }
	    goto L150;
 
L120:
	    if (ell_ .kz[jk - 1] != 8) {
		etl += ell_ .el[jk - 1];
	    }
	    for (l = 1; l <= 2; ++l) {
		ll = l << 1;
		if ((d__1 = t[ll + (ll - 1) * 6 - 7], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		    phibf[l - 1] = atan(t[ll + 1 + (ll - 1) * 6 - 7] / t[ll + 
			    (ll - 1) * 6 - 7]);
		} else {
		    phibf[l - 1] = 0.;
		}
		puf = t[(ll - 1) * 6 - 1];
		t[(ll - 1) * 6 - 1] = (aeg[jk + (l + 2) * 700 - 2101] * (t[(
			ll - 1) * 6 - 6] + puf * clo_ .ded) + aeg[jk + (l + 4)
			 * 700 - 2101] * (t[ll * 6 - 6] + t[ll * 6 - 1] * 
			clo_ .ded) + aeg[jk + (l + 10) * 700 - 2101] * dpp1 * 
			1e3 - mat_ .a[jk + (l + 2) * 700 - 2101] * t[(ll - 1) 
			* 6 - 6] - mat_ .a[jk + (l + 4) * 700 - 2101] * t[ll *
			 6 - 6] - mat_ .a[jk + (l + 10) * 700 - 2101] * dpr[0]
			) / clo_ .ded;
		t[ll * 6 - 1] = (aeg[jk + (l + 6) * 700 - 2101] * (t[(ll - 1) 
			* 6 - 6] + puf * clo_ .ded) + aeg[jk + (l + 8) * 700 
			- 2101] * (t[ll * 6 - 6] + t[ll * 6 - 1] * clo_ .ded) 
			+ aeg[jk + (l + 12) * 700 - 2101] * dpp1 * 1e3 - 
			mat_ .a[jk + (l + 6) * 700 - 2101] * t[(ll - 1) * 6 - 
			6] - mat_ .a[jk + (l + 8) * 700 - 2101] * t[ll * 6 - 
			6] - mat_ .a[jk + (l + 12) * 700 - 2101] * dpr[0]) / 
			clo_ .ded;
		i__3 = ium - 1;
		for (i__ = 1; i__ <= i__3; ++i__) {
		    puf = t[i__ + (ll - 1) * 6 - 7];
		    t[i__ + (ll - 1) * 6 - 7] = puf * mat_ .a[jk + (l + 2) * 
			    700 - 2101] + t[i__ + ll * 6 - 7] * mat_ .a[jk + (
			    l + 4) * 700 - 2101] + dpr[i__ - 1] * mat_ .a[jk 
			    + (l + 10) * 700 - 2101];
 
		    t[i__ + ll * 6 - 7] = puf * mat_ .a[jk + (l + 6) * 700 - 
			    2101] + t[i__ + ll * 6 - 7] * mat_ .a[jk + (l + 8)
			     * 700 - 2101] + dpr[i__ - 1] * mat_ .a[jk + (l + 
			    12) * 700 - 2101];
		}
	    }
	    for (l = 1; l <= 2; ++l) {
		ll = l << 1;
		if ((d__1 = t[ll + (ll - 1) * 6 - 7], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		    dphi = atan(t[ll + 1 + (ll - 1) * 6 - 7] / t[ll + (ll - 1)
			     * 6 - 7]) - phibf[l - 1];
		} else {
		    dphi = -phibf[l - 1];
		}
		if (-dphi > 1e-17) {
		    dphi += kons_ .pi;
		}
 
		phi[l - 1] += dphi / pie;
	    }
	    ++nr;
	    writelin_(&nr, linopc_ .bez + (jk - 1 << 4), &etl, phi, t, &ix, 
		    16L);
	    if (linop_ .ntco != 0 && nr % linop_ .ntco == 0) {
		cpltwis_(linopc_ .bez + (jk - 1 << 4), t, &etl, phi, 16L);
	    }
L150:
	    ;
	}
	goto L500;
 
L160:
	if (ix <= 0) {
	    goto L190;
	}
 
	etl += linop_ .elbe[ix - 1];
	for (l = 1; l <= 2; ++l) {
	    ll = l << 1;
	    if ((d__1 = t[ll + (ll - 1) * 6 - 7], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		phibf[l - 1] = atan(t[ll + 1 + (ll - 1) * 6 - 7] / t[ll + (ll 
			- 1) * 6 - 7]);
	    } else {
		phibf[l - 1] = 0.;
	    }
	    puf = t[(ll - 1) * 6 - 1];
	    t[(ll - 1) * 6 - 1] = (bl1eg[ix + (l + 2) * 300 - 901] * (t[(ll - 
		    1) * 6 - 6] + puf * clo_ .ded) + bl1eg[ix + (l + 4) * 300 
		    - 901] * (t[ll * 6 - 6] + t[ll * 6 - 1] * clo_ .ded) + 
		    bl1eg[ix + (l + 10) * 300 - 901] * dpp1 * 1e3 - mat_ .bl1[
		    ix + (l + 2) * 300 - 901] * t[(ll - 1) * 6 - 6] - 
		    mat_ .bl1[ix + (l + 4) * 300 - 901] * t[ll * 6 - 6] - 
		    mat_ .bl1[ix + (l + 10) * 300 - 901] * dpr[0]) / 
		    clo_ .ded;
	    t[ll * 6 - 1] = (bl1eg[ix + (l + 6) * 300 - 901] * (t[(ll - 1) * 
		    6 - 6] + puf * clo_ .ded) + bl1eg[ix + (l + 8) * 300 - 
		    901] * (t[ll * 6 - 6] + t[ll * 6 - 1] * clo_ .ded) + 
		    bl1eg[ix + (l + 12) * 300 - 901] * dpp1 * 1e3 - mat_ .bl1[
		    ix + (l + 6) * 300 - 901] * t[(ll - 1) * 6 - 6] - 
		    mat_ .bl1[ix + (l + 8) * 300 - 901] * t[ll * 6 - 6] - 
		    mat_ .bl1[ix + (l + 12) * 300 - 901] * dpr[0]) / 
		    clo_ .ded;
	    i__2 = ium - 1;
	    for (i__ = 1; i__ <= i__2; ++i__) {
		puf = t[i__ + (ll - 1) * 6 - 7];
		t[i__ + (ll - 1) * 6 - 7] = mat_ .bl1[ix + (l + 2) * 300 - 
			901] * puf + mat_ .bl1[ix + (l + 4) * 300 - 901] * t[
			i__ + ll * 6 - 7] + dpr[i__ - 1] * mat_ .bl1[ix + (l 
			+ 10) * 300 - 901];
 
		t[i__ + ll * 6 - 7] = mat_ .bl1[ix + (l + 6) * 300 - 901] * 
			puf + mat_ .bl1[ix + (l + 8) * 300 - 901] * t[i__ + 
			ll * 6 - 7] + dpr[i__ - 1] * mat_ .bl1[ix + (l + 12) *
			 300 - 901];
	    }
	}
	for (l = 1; l <= 2; ++l) {
	    ll = l << 1;
	    if ((d__1 = t[ll + (ll - 1) * 6 - 7], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		dphi = atan(t[ll + 1 + (ll - 1) * 6 - 7] / t[ll + (ll - 1) * 
			6 - 7]) - phibf[l - 1];
	    } else {
		dphi = -phibf[l - 1];
	    }
	    if (-dphi > 1e-17) {
		dphi += kons_ .pi;
	    }
 
	    phi[l - 1] += dphi / pie;
	}
	++nr;
	writelin_(&nr, linopc_ .bezb + (ix - 1 << 4), &etl, phi, t, &ix, 16L);
	if (linop_ .ntco != 0 && nr % linop_ .ntco == 0) {
	    cpltwis_(linopc_ .bezb + (ix - 1 << 4), t, &etl, phi, 16L);
	}
	goto L500;
 
L190:
	ix = -ix;
	etl += linop_ .elbe[ix - 1];
	for (l = 1; l <= 2; ++l) {
	    ll = l << 1;
	    if ((d__1 = t[ll + (ll - 1) * 6 - 7], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		phibf[l - 1] = atan(t[ll + 1 + (ll - 1) * 6 - 7] / t[ll + (ll 
			- 1) * 6 - 7]);
	    } else {
		phibf[l - 1] = 0.;
	    }
	    puf = t[(ll - 1) * 6 - 1];
	    t[(ll - 1) * 6 - 1] = (bl2eg[ix + (l + 2) * 300 - 901] * (t[(ll - 
		    1) * 6 - 6] + puf * clo_ .ded) + bl2eg[ix + (l + 4) * 300 
		    - 901] * (t[ll * 6 - 6] + t[ll * 6 - 1] * clo_ .ded) + 
		    bl2eg[ix + (l + 10) * 300 - 901] * dpp1 * 1e3 - mat_ .bl2[
		    ix + (l + 2) * 300 - 901] * t[(ll - 1) * 6 - 6] - 
		    mat_ .bl2[ix + (l + 4) * 300 - 901] * t[ll * 6 - 6] - 
		    mat_ .bl2[ix + (l + 10) * 300 - 901] * dpr[0]) / 
		    clo_ .ded;
	    t[ll * 6 - 1] = (bl2eg[ix + (l + 6) * 300 - 901] * (t[(ll - 1) * 
		    6 - 6] + puf * clo_ .ded) + bl2eg[ix + (l + 8) * 300 - 
		    901] * (t[ll * 6 - 6] + t[ll * 6 - 1] * clo_ .ded) + 
		    bl2eg[ix + (l + 12) * 300 - 901] * dpp1 * 1e3 - mat_ .bl2[
		    ix + (l + 6) * 300 - 901] * t[(ll - 1) * 6 - 6] - 
		    mat_ .bl2[ix + (l + 8) * 300 - 901] * t[ll * 6 - 6] - 
		    mat_ .bl2[ix + (l + 12) * 300 - 901] * dpr[0]) / 
		    clo_ .ded;
	    i__2 = ium - 1;
	    for (i__ = 1; i__ <= i__2; ++i__) {
		puf = t[i__ + (ll - 1) * 6 - 7];
		t[i__ + (ll - 1) * 6 - 7] = mat_ .bl2[ix + (l + 2) * 300 - 
			901] * puf + mat_ .bl2[ix + (l + 4) * 300 - 901] * t[
			i__ + ll * 6 - 7] + dpr[i__ - 1] * mat_ .bl2[ix + (l 
			+ 10) * 300 - 901];
 
		t[i__ + ll * 6 - 7] = mat_ .bl2[ix + (l + 6) * 300 - 901] * 
			puf + mat_ .bl2[ix + (l + 8) * 300 - 901] * t[i__ + 
			ll * 6 - 7] + dpr[i__ - 1] * mat_ .bl2[ix + (l + 12) *
			 300 - 901];
	    }
	}
	for (l = 1; l <= 2; ++l) {
	    ll = l << 1;
	    if ((d__1 = t[ll + (ll - 1) * 6 - 7], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		dphi = atan(t[ll + 1 + (ll - 1) * 6 - 7] / t[ll + (ll - 1) * 
			6 - 7]) - phibf[l - 1];
	    } else {
		dphi = -phibf[l - 1];
	    }
	    if (-dphi > 1e-17) {
		dphi += kons_ .pi;
	    }
 
	    phi[l - 1] += dphi / pie;
	}
	++nr;
	writelin_(&nr, linopc_ .bezb + (ix - 1 << 4), &etl, phi, t, &ix, 16L);
	if (linop_ .ntco != 0 && nr % linop_ .ntco == 0) {
	    cpltwis_(linopc_ .bezb + (ix - 1 << 4), t, &etl, phi, 16L);
	}
	goto L500;
 
L220:
	ix += -300;
	qu = 0.;
	qv = 0.;
	dyy1 = 0.;
	dyy2 = 0.;
	kpz = ell_ .kp[ix - 1];
	if (kpz == 6) {
	    goto L500;
	}
	kzz = ell_ .kz[ix - 1];
	if (kzz == 0) {
	    goto L500;
	}
	if (kzz == 20 && beam_ .nbeam >= 1) {
	    beam_ .nbeam = k;
	    ++nr;
	    writelin_(&nr, linopc_ .bez + (ix - 1 << 4), &etl, phi, t, &ix, 
		    16L);
	}
	dyy1 = 0.;
	dyy2 = 0.;
	if (rand0_ .iorg < 0) {
	    rand0_ .mzu[k - 1] = izu;
	}
	izu = rand0_ .mzu[k - 1] + 1;
	ekk = (ell_ .sm[ix - 1] + rand0_ .zfz[izu - 1] * ell_ .ek[ix - 1]) / (
		*dpp + 1.);
	++izu;
	xs = pla_ .xpl[ix - 1] + rand0_ .zfz[izu - 1] * pla_ .xrms[ix - 1];
	++izu;
	zs = pla_ .zpl[ix - 1] + rand0_ .zfz[izu - 1] * pla_ .zrms[ix - 1];
	xl = (t[0] - xs) * rand1_ .tiltc[k - 1] + (t[12] - zs) * 
		rand1_ .tilts[k - 1];
	zl = -(t[0] - xs) * rand1_ .tilts[k - 1] + (t[12] - zs) * 
		rand1_ .tiltc[k - 1];
	crkve = xl;
	cikve = zl;
	if (kzz < 0) {
	    goto L370;
	}
	switch ((int)kzz) {
	    case 1:  goto L230;
	    case 2:  goto L240;
	    case 3:  goto L250;
	    case 4:  goto L260;
	    case 5:  goto L270;
	    case 6:  goto L280;
	    case 7:  goto L290;
	    case 8:  goto L300;
	    case 9:  goto L310;
	    case 10:  goto L320;
	    case 11:  goto L330;
	}
	goto L500;
 
L230:
	ekk *= 1e3;
	dyy1 = ekk * rand1_ .tiltc[k - 1];
	dyy2 = ekk * rand1_ .tilts[k - 1];
	qu = 0.;
	qv = 0.;
	goto L480;
 
L240:
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cikve + rand1_ .tilts[k - 1] * 
		crkve);
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * tiltck;
	qv = -ekk * tiltsk;
	goto L480;
 
L250:
	ekk *= .001;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 2. * (tiltck * crkve + tiltsk * cikve);
	qv = ekk * 2. * (tiltck * cikve - tiltsk * crkve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cikve + rand1_ .tilts[k - 1] * 
		crkve);
	goto L480;
 
L260:
	ekk *= 1e-6;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 3. * (tiltck * crkve + tiltsk * cikve);
	qv = ekk * 3. * (tiltck * cikve - tiltsk * crkve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cikve + rand1_ .tilts[k - 1] * 
		crkve);
	goto L480;
 
L270:
	ekk *= 1e-9;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 4. * (tiltck * crkve + tiltsk * cikve);
	qv = ekk * 4. * (tiltck * cikve - tiltsk * crkve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cikve + rand1_ .tilts[k - 1] * 
		crkve);
	goto L480;
 
L280:
	ekk *= 1e-12;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 5 * (tiltck * crkve + tiltsk * cikve);
	qv = ekk * 5 * (tiltck * cikve - tiltsk * crkve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cikve + rand1_ .tilts[k - 1] * 
		crkve);
	goto L480;
 
L290:
	ekk *= 1e-15;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 6 * (tiltck * crkve + tiltsk * cikve);
	qv = ekk * 6 * (tiltck * cikve - tiltsk * crkve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cikve + rand1_ .tilts[k - 1] * 
		crkve);
	goto L480;
 
L300:
	ekk *= 1e-18;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 7 * (tiltck * crkve + tiltsk * cikve);
	qv = ekk * 7 * (tiltck * cikve - tiltsk * crkve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cikve + rand1_ .tilts[k - 1] * 
		crkve);
	goto L480;
 
L310:
	ekk *= 1e-21;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 8 * (tiltck * crkve + tiltsk * cikve);
	qv = ekk * 8 * (tiltck * cikve - tiltsk * crkve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cikve + rand1_ .tilts[k - 1] * 
		crkve);
	goto L480;
 
L320:
	ekk *= 1e-24;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 9 * (tiltck * crkve + tiltsk * cikve);
	qv = ekk * 9 * (tiltck * cikve - tiltsk * crkve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cikve + rand1_ .tilts[k - 1] * 
		crkve);
	goto L480;
L330:
	r0 = ell_ .ek[ix - 1];
	if ((d__1 = dkic_ .dki[ix - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
	    if ((d__1 = dkic_ .dki[ix + 1399], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		qu = - dkic_ .dki[ix - 1] / dkic_ .dki[ix + 1399] * dkic_ .dki[
			ix - 1] / (*dpp + 1.);
		dppi = dkic_ .dki[ix - 1] * 1e3 / (*dpp + 1.);
		t[6] = t[6] + (qu * xl - dppi * *dpp) * rand1_ .tiltc[k - 1] 
			+ dppi * (1. - rand1_ .tiltc[k - 1]);
		t[18] = t[18] + (qu * xl - dppi * *dpp) * rand1_ .tilts[k - 1]
			 + dppi * rand1_ .tilts[k - 1];
		t[11] = t[11] - (qu * xl + dppi) / (*dpp + 1.) * 
			rand1_ .tiltc[k - 1] - dppi / (*dpp + 1.) * (1. - 
			rand1_ .tiltc[k - 1]);
		t[23] = t[23] - (qu * xl + dppi) / (*dpp + 1.) * 
			rand1_ .tilts[k - 1] - dppi / (*dpp + 1.) * 
			rand1_ .tilts[k - 1];
		i__2 = ium;
		for (i__ = 2; i__ <= i__2; ++i__) {
		    t[i__ + 5] += qu * t[i__ - 1] * rand1_ .tiltc[k - 1];
		    t[i__ + 17] += qu * t[i__ + 11] * rand1_ .tilts[k - 1];
 
		}
	    } else {
		dppi = dkic_ .dki[ix - 1] * 1e3 / (*dpp + 1.);
		t[6] = t[6] - dppi * *dpp * rand1_ .tiltc[k - 1] + dppi * (1. 
			- rand1_ .tiltc[k - 1]);
		t[18] = t[18] - dppi * *dpp * rand1_ .tilts[k - 1] + dppi * 
			rand1_ .tilts[k - 1];
		t[11] = t[11] - dppi / (*dpp + 1.) * rand1_ .tiltc[k - 1] - 
			dppi / (*dpp + 1.) * (1. - rand1_ .tiltc[k - 1]);
		t[23] = t[23] - dppi / (*dpp + 1.) * rand1_ .tilts[k - 1] - 
			dppi / (*dpp + 1.) * rand1_ .tilts[k - 1];
	    }
	}
	if ((d__1 = dkic_ .dki[ix + 699], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
	    if ((d__1 = dkic_ .dki[ix + 1399], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		qu = dkic_ .dki[ix + 699] / dkic_ .dki[ix + 1399] * 
			dkic_ .dki[ix + 699] / (*dpp + 1.);
		dppi = dkic_ .dki[ix + 699] * 1e3 / (*dpp + 1.);
		t[6] = t[6] + (qu * zl - dppi * *dpp) * rand1_ .tilts[k - 1] 
			+ dppi * rand1_ .tilts[k - 1];
		t[18] = t[18] + (-qu * zl + dppi * *dpp) * rand1_ .tiltc[k - 
			1] - dppi * (1. - rand1_ .tiltc[k - 1]);
		t[11] = t[11] + (-qu * zl - dppi) / (*dpp + 1.) * 
			rand1_ .tilts[k - 1] - dppi / (*dpp + 1.) * 
			rand1_ .tilts[k - 1];
		t[23] = t[23] + (qu * zl + dppi) / (*dpp + 1.) * 
			rand1_ .tiltc[k - 1] + dppi / (*dpp + 1.) * (1. - 
			rand1_ .tiltc[k - 1]);
		i__2 = ium;
		for (i__ = 2; i__ <= i__2; ++i__) {
		    t[i__ + 5] += qu * t[i__ - 1] * rand1_ .tilts[k - 1];
		    t[i__ + 17] -= qu * t[i__ + 11] * rand1_ .tiltc[k - 1];
 
		}
	    } else {
		dppi = dkic_ .dki[ix + 699] * 1e3 / (*dpp + 1.);
		t[6] = t[6] - dppi * *dpp * rand1_ .tilts[k - 1] + dppi * 
			rand1_ .tilts[k - 1];
		t[18] = t[18] + dppi * *dpp * rand1_ .tiltc[k - 1] - dppi * (
			1. - rand1_ .tiltc[k - 1]);
		t[11] = t[11] - dppi / (*dpp + 1.) * rand1_ .tilts[k - 1] - 
			dppi / (*dpp + 1.) * rand1_ .tilts[k - 1];
		t[23] = t[23] + dppi / (*dpp + 1.) * rand1_ .tiltc[k - 1] + 
			dppi / (*dpp + 1.) * (1. - rand1_ .tiltc[k - 1]);
	    }
	}
	if ((( r0 ) >= 0 ? ( r0 ) : -( r0 ))  <= 1e-17) {
	    goto L500;
	}
	nmz = mult1_ .nmu[ix - 1];
	if (nmz == 0) {
	    izu += 22;
	    goto L500;
	}
	im = mult1_ .irm[ix - 1];
	r0a = 1.;
	benkr = ell_ .ed[ix - 1] / (*dpp + 1.);
	i__2 = nmz;
	for (l = 1; l <= i__2; ++l) {
	    ++izu;
	    aa[l - 1] = multi_ .ak0[im + l * 700 - 701] + rand0_ .zfz[izu - 1]
		     * multi_ .aka[im + l * 700 - 701];
	    aa[l - 1] = benkr * aa[l - 1] / r0a;
	    ++izu;
	    bb[l - 1] = multi_ .bk0[im + l * 700 - 701] + rand0_ .zfz[izu - 1]
		     * multi_ .bka[im + l * 700 - 701];
	    bb[l - 1] = benkr * bb[l - 1] / r0a;
	    r0a *= r0;
 
	}
	if (nmz >= 2) {
	    qu = bb[1];
	    qv = -aa[1];
	    dyy1 = bb[0] + bb[1] * crkve + aa[1] * cikve;
	    dyy2 = aa[0] - bb[1] * cikve + aa[1] * crkve;
	    i__2 = nmz;
	    for (l = 3; l <= i__2; ++l) {
		l1 = l - 1;
		qu += l1 * (bb[l - 1] * crkve + aa[l - 1] * cikve);
		qv += l1 * (bb[l - 1] * cikve - aa[l - 1] * crkve);
		crkveuk = crkve * xl - cikve * zl;
		cikve = crkve * zl + cikve * xl;
		crkve = crkveuk;
		dyy1 = dyy1 + bb[l - 1] * crkve + aa[l - 1] * cikve;
		dyy2 = dyy2 - bb[l - 1] * cikve + aa[l - 1] * crkve;
 
	    }
	} else {
	    qu = 0.;
	    qv = 0.;
	    dyy1 = bb[0];
	    dyy2 = aa[0];
	}
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu1 = tiltck * qu - tiltsk * qv;
	qv = tiltck * qv + tiltsk * qu;
	qu = qu1;
	dyy11 = rand1_ .tiltc[k - 1] * dyy1 - rand1_ .tilts[k - 1] * dyy2;
	dyy2 = rand1_ .tiltc[k - 1] * dyy2 + rand1_ .tilts[k - 1] * dyy1;
	dyy1 = dyy11;
	izu = izu + 22 - (nmz << 1);
	goto L480;
 
L370:
	kzz = -kzz;
	switch ((int)kzz) {
	    case 1:  goto L380;
	    case 2:  goto L390;
	    case 3:  goto L400;
	    case 4:  goto L410;
	    case 5:  goto L420;
	    case 6:  goto L430;
	    case 7:  goto L440;
	    case 8:  goto L450;
	    case 9:  goto L460;
	    case 10:  goto L470;
	}
	goto L500;
 
L380:
	ekk *= 1e3;
	dyy1 = -ekk * rand1_ .tilts[k - 1];
	dyy2 = ekk * rand1_ .tiltc[k - 1];
	qu = 0.;
	qv = 0.;
	goto L480;
 
L390:
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cikve - rand1_ .tilts[k - 1] * 
		crkve);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = -ekk * tiltsk;
	qv = -ekk * tiltck;
	goto L480;
 
L400:
	ekk *= .001;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 2. * (tiltck * cikve - tiltsk * crkve);
	qv = -ekk * 2. * (tiltck * crkve + tiltsk * cikve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cikve - rand1_ .tilts[k - 1] * 
		crkve);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	goto L480;
 
L410:
	ekk *= 1e-6;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 3. * (tiltck * cikve - tiltsk * crkve);
	qv = ekk * -3. * (tiltck * crkve + tiltsk * cikve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cikve - rand1_ .tilts[k - 1] * 
		crkve);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	goto L480;
 
L420:
	ekk *= 1e-9;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 4. * (tiltck * cikve - tiltsk * crkve);
	qv = ekk * -4. * (tiltck * crkve + tiltsk * cikve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cikve - rand1_ .tilts[k - 1] * 
		crkve);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	goto L480;
 
L430:
	ekk *= 1e-12;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 5 * (tiltck * cikve - tiltsk * crkve);
	qv = ekk * -5 * (tiltck * crkve + tiltsk * cikve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cikve - rand1_ .tilts[k - 1] * 
		crkve);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	goto L480;
 
L440:
	ekk *= 1e-15;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 6 * (tiltck * cikve - tiltsk * crkve);
	qv = ekk * -6 * (tiltck * crkve + tiltsk * cikve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cikve - rand1_ .tilts[k - 1] * 
		crkve);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	goto L480;
 
L450:
	ekk *= 1e-18;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 7 * (tiltck * cikve - tiltsk * crkve);
	qv = ekk * -7 * (tiltck * crkve + tiltsk * cikve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cikve - rand1_ .tilts[k - 1] * 
		crkve);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	goto L480;
 
L460:
	ekk *= 1e-21;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 8 * (tiltck * cikve - tiltsk * crkve);
	qv = ekk * -8 * (tiltck * crkve + tiltsk * cikve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cikve - rand1_ .tilts[k - 1] * 
		crkve);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	goto L480;
 
L470:
	ekk *= 1e-24;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 9 * (tiltck * cikve - tiltsk * crkve);
	qv = ekk * -9 * (tiltck * crkve + tiltsk * cikve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cikve - rand1_ .tilts[k - 1] * 
		crkve);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
L480:
	t[11] -= dyy1 / (*dpp + 1.);
	t[23] -= dyy2 / (*dpp + 1.);
	t[6] += dyy1;
	t[18] += dyy2;
	i__2 = ium;
	for (i__ = 2; i__ <= i__2; ++i__) {
	    t[i__ + 5] = t[i__ + 5] + qu * t[i__ - 1] - qv * t[i__ + 11];
 
	    t[i__ + 17] = t[i__ + 17] - qu * t[i__ + 11] - qv * t[i__ - 1];
	}
	++nr;
	writelin_(&nr, linopc_ .bez + (ix - 1 << 4), &etl, phi, t, &ix, 16L);
	if (linop_ .ntco != 0 && nr % linop_ .ntco == 0) {
	    cpltwis_(linopc_ .bez + (ix - 1 << 4), t, &etl, phi, 16L);
	}
L500:
	;
    }
    clorb_(& clo_ .ded);
    for (l = 1; l <= 2; ++l) {
	clo0[l - 1] = (tra_._1) .clo[l - 1];
	clop0[l - 1] = (tra_._1) .clop[l - 1];
 
    }
    clorb_(&c_b251);
    for (l = 1; l <= 2; ++l) {
	ll = l << 1;
	beo_ .di0[l - 1] = (clo0[l - 1] - (tra_._1) .clo[l - 1]) / clo_ .ded;
	beo_ .dip0[l - 1] = (clop0[l - 1] - (tra_._1) .clop[l - 1]) / clo_ .ded;
 
    }
    if (clos_ .ncorru == 0) {
	s_wsfe(&io___2679);
	e_wsfe();
    }
 

    return 0;
}  

 
 
  int loesd_(rmat, vec, dimakt, dimtot, kod)
doublereal *rmat, *vec;
integer *dimakt, *dimtot, *kod;
{
     

    static doublereal eps = 1e-20;

     
    integer rmat_dim1, rmat_offset, i__1, i__2, i__3;
    doublereal d__1;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer j, k, l, n;
    static doublereal r__;
    static integer n1, ik, jk, kk, jy, indi;
    static doublereal emax;

     
    static cilist io___2685 = { 0, 6, 0, 0, 0 };


 

 
 
 

     
    --vec;
    rmat_dim1 = *dimtot;
    rmat_offset = rmat_dim1 + 1;
    rmat -= rmat_offset;

     
    *kod = 1;
    i__1 = *dimakt;
    for (j = 1; j <= i__1; ++j) {
	emax = 0.;
	i__2 = *dimakt;
	for (ik = j; ik <= i__2; ++ik) {
	    if ((( emax ) >= 0 ? ( emax ) : -( emax ))  > (d__1 = rmat[j + ik * rmat_dim1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) || 
		    emax != emax) {
		goto L10;
	    }
	    emax = rmat[j + ik * rmat_dim1];
	    indi = ik;
L10:
	    ;
	}
	if ((( emax ) >= 0 ? ( emax ) : -( emax ))  < eps) {
	    s_wsle(&io___2685);
	    do_lio(&c__9, &c__1, "  ****   ERROR IN LOESD   **** ", 31L);
	    e_wsle();
	    return 0;
	}
 
	i__2 = *dimakt;
	for (l = j; l <= i__2; ++l) {
	    r__ = rmat[l + j * rmat_dim1];
	    rmat[l + j * rmat_dim1] = rmat[l + indi * rmat_dim1];
	    rmat[l + indi * rmat_dim1] = r__;
	    rmat[l + j * rmat_dim1] /= emax;
 
	}
	r__ = vec[indi];
	vec[indi] = vec[j];
	vec[j] = r__ / emax;
	if (j == *dimakt) {
	    goto L60;
	}
	jy = j + 1;
	i__2 = *dimakt;
	for (jk = jy; jk <= i__2; ++jk) {
	    r__ = rmat[j + jk * rmat_dim1];
	    i__3 = *dimakt;
	    for (kk = jy; kk <= i__3; ++kk) {
		rmat[kk + jk * rmat_dim1] -= r__ * rmat[kk + j * rmat_dim1];
 
	    }
	    vec[jk] -= vec[j] * r__;
 
	}
    }
L60:
    n = *dimakt;
    n1 = *dimakt - 1;
    i__2 = n1;
    for (j = 1; j <= i__2; ++j) {
	i__1 = j;
	for (k = 1; k <= i__1; ++k) {
	    vec[n - j] -= rmat[n - k + 1 + (n - j) * rmat_dim1] * vec[n - k + 
		    1];
 
	}
    }
    *kod = 0;
    return 0;
}  

 
 
  int lostpar2_(i__, ix, nthinerr)
integer *i__, *ix, *nthinerr;
{
     
    static char fmt_10000[] = "(\002 \002/t10,\002TRACKING ENDED ABNORMALLY\002/t10,\002PARTICLE \002,i3,\002 RANDOM SEED \002,i8,\002 MOMENTUM DEVIATION \002,g12.5/t10,\002 LOST IN REVOLUTION \002,i8,\002 AT ELEMENT \002,i4/t10,\002HORIZ:  AMPLITUDE = \002,f15.3,\002   APERTURE = \002,f15.3/t10,\002VERT:   AMPLITUDE = \002,f15.3,\002   APERTURE = \002,f15.3/t10,\002ELEMENT - LIST NUMBER \002,i4,\002 TYP NUMBER \002,i4,\002 NAME \002,a16/)";

     
    integer i__1, i__2;
    doublereal d__1, d__2, d__3, d__4;

     
    integer s_wsfe(), do_fio(), e_wsfe(), s_wsle(), e_wsle(), do_lio();

     
    extern   int synuthck_();
    static integer j, jj, ib2, ib3, jj1, lnapx, jjj, ilostch;

     
    static cilist io___2696 = { 0, 6, 0, fmt_10000, 0 };
    static cilist io___2697 = { 0, 6, 0, fmt_10000, 0 };
    static cilist io___2704 = { 0, 6, 0, 0, 0 };
    static cilist io___2705 = { 0, 6, 0, 0, 0 };
    static cilist io___2706 = { 0, 6, 0, 0, 0 };
    static cilist io___2707 = { 0, 6, 0, 0, 0 };
    static cilist io___2708 = { 0, 6, 0, 0, 0 };
    static cilist io___2709 = { 0, 6, 0, 0, 0 };
    static cilist io___2710 = { 0, 6, 0, 0, 0 };
    static cilist io___2711 = { 0, 6, 0, 0, 0 };


 


 
 

 
 

    ilostch = 0;
    i__1 = tra1_ .napx;
    for (j = 1; j <= i__1; ++j) {
	if ((d__1 = main1_ .xv[(j << 1) - 2], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > beo_ .aper[0] || (
		d__2 = main1_ .xv[(j << 1) - 1], (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) ) > beo_ .aper[1] ||
		 main1_ .xv[(j << 1) - 2] != main1_ .xv[(j << 1) - 2] || 
		main1_ .xv[(j << 1) - 1] != main1_ .xv[(j << 1) - 1]) {
	    ilostch = 1;
	    main1_ .pstop[main1_ .nlostp[j - 1] - 1] = (1) ;
	}
 
    }
    i__1 = tra1_ .napx;
    for (j = 1; j <= i__1; ++j) {
	if (main1_ .pstop[main1_ .nlostp[j - 1] - 1]) {
	    main2_ .aperv[main1_ .nlostp[j - 1] - 1] = beo_ .aper[0];
	    main2_ .aperv[main1_ .nlostp[j - 1] + 63] = beo_ .aper[1];
	    main2_ .iv[main1_ .nlostp[j - 1] - 1] = *i__;
	    main2_ .ixv[main1_ .nlostp[j - 1] - 1] = *ix;
	    main2_ .xvl[(main1_ .nlostp[j - 1] << 1) - 2] = main1_ .xv[(j << 
		    1) - 2];
	    main2_ .xvl[(main1_ .nlostp[j - 1] << 1) - 1] = main1_ .xv[(j << 
		    1) - 1];
	    main2_ .yvl[(main1_ .nlostp[j - 1] << 1) - 2] = main1_ .yv[(j << 
		    1) - 2];
	    main2_ .yvl[(main1_ .nlostp[j - 1] << 1) - 1] = main1_ .yv[(j << 
		    1) - 1];
	    main2_ .dpsvl[main1_ .nlostp[j - 1] - 1] = main1_ .dpsv[j - 1];
	    main2_ .ejvl[main1_ .nlostp[j - 1] - 1] = main1_ .ejv[j - 1];
	    main2_ .sigmvl[main1_ .nlostp[j - 1] - 1] = main1_ .sigmv[j - 1];
	    main1_ .numxv[main1_ .nlostp[j - 1] - 1] = main4_ .numx;
	    postr2_ .nnumxv[main1_ .nlostp[j - 1] - 1] = main4_ .numx;
	    if ((doublereal) (main1_ .nlostp[j - 1] % 2) == 1.) {
		s_wsfe(&io___2696);
		do_fio(&c__1, (char *)& main1_ .nlostp[j - 1], (ftnlen)sizeof(
			integer));
		i__2 = main1_ .nms[main1_ .nlostp[j - 1] - 1] * rand0_ .izu0;
		do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)& main1_ .dp0v[main1_ .nlostp[j - 1] - 1]
			, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& main1_ .numxv[main1_ .nlostp[j - 1] - 
			1], (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)& main2_ .iv[main1_ .nlostp[j - 1] - 1], 
			(ftnlen)sizeof(integer));
		d__2 = (d__1 = main2_ .xvl[(main1_ .nlostp[j - 1] << 1) - 2], 
			(( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
		do_fio(&c__1, (char *)&d__2, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& main2_ .aperv[main1_ .nlostp[j - 1] - 
			1], (ftnlen)sizeof(doublereal));
		d__4 = (d__3 = main2_ .xvl[(main1_ .nlostp[j - 1] << 1) - 1], 
			(( d__3 ) >= 0 ? ( d__3 ) : -( d__3 )) );
		do_fio(&c__1, (char *)&d__4, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& main2_ .aperv[main1_ .nlostp[j - 1] + 
			63], (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& main2_ .ixv[main1_ .nlostp[j - 1] - 1],
			 (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)& ell_ .kz[main2_ .ixv[main1_ .nlostp[j 
			- 1] - 1] - 1], (ftnlen)sizeof(integer));
		do_fio(&c__1, linopc_ .bez + (main2_ .ixv[main1_ .nlostp[j - 
			1] - 1] - 1 << 4), 16L);
		e_wsfe();
	    } else {
		s_wsfe(&io___2697);
		do_fio(&c__1, (char *)& main1_ .nlostp[j - 1], (ftnlen)sizeof(
			integer));
		i__2 = main1_ .nms[main1_ .nlostp[j - 1] - 2] * rand0_ .izu0;
		do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)& main1_ .dp0v[main1_ .nlostp[j - 1] - 2]
			, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& main1_ .numxv[main1_ .nlostp[j - 1] - 
			1], (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)& main2_ .iv[main1_ .nlostp[j - 1] - 1], 
			(ftnlen)sizeof(integer));
		d__2 = (d__1 = main2_ .xvl[(main1_ .nlostp[j - 1] << 1) - 2], 
			(( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
		do_fio(&c__1, (char *)&d__2, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& main2_ .aperv[main1_ .nlostp[j - 1] - 
			1], (ftnlen)sizeof(doublereal));
		d__4 = (d__3 = main2_ .xvl[(main1_ .nlostp[j - 1] << 1) - 1], 
			(( d__3 ) >= 0 ? ( d__3 ) : -( d__3 )) );
		do_fio(&c__1, (char *)&d__4, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& main2_ .aperv[main1_ .nlostp[j - 1] + 
			63], (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& main2_ .ixv[main1_ .nlostp[j - 1] - 1],
			 (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)& ell_ .kz[main2_ .ixv[main1_ .nlostp[j 
			- 1] - 1] - 1], (ftnlen)sizeof(integer));
		do_fio(&c__1, linopc_ .bez + (main2_ .ixv[main1_ .nlostp[j - 
			1] - 1] - 1 << 4), 16L);
		e_wsfe();
	    }
	}
 
    }
    lnapx = tra1_ .napx;
    for (j = tra1_ .napx; j >= 1; --j) {
	if (main1_ .pstop[main1_ .nlostp[j - 1] - 1]) {
	    if (j != lnapx) {
		i__1 = lnapx - 1;
		for (jj = j; jj <= i__1; ++jj) {
		    jj1 = jj + 1;
		    main1_ .nlostp[jj - 1] = main1_ .nlostp[jj1 - 1];
		    main1_ .xv[(jj << 1) - 2] = main1_ .xv[(jj1 << 1) - 2];
		    main1_ .xv[(jj << 1) - 1] = main1_ .xv[(jj1 << 1) - 1];
		    main1_ .yv[(jj << 1) - 2] = main1_ .yv[(jj1 << 1) - 2];
		    main1_ .yv[(jj << 1) - 1] = main1_ .yv[(jj1 << 1) - 1];
		    main1_ .dpsv[jj - 1] = main1_ .dpsv[jj1 - 1];
		    main1_ .sigmv[jj - 1] = main1_ .sigmv[jj1 - 1];
		    main1_ .ejfv[jj - 1] = main1_ .ejfv[jj1 - 1];
		    main1_ .ejv[jj - 1] = main1_ .ejv[jj1 - 1];
		    main1_ .rvv[jj - 1] = main1_ .rvv[jj1 - 1];
		    main2_ .oidpsv[jj - 1] = main2_ .oidpsv[jj1 - 1];
		    track_ .dpsv1[jj - 1] = track_ .dpsv1[jj1 - 1];
		    main3_ .clo6v[jj * 3 - 3] = main3_ .clo6v[jj1 * 3 - 3];
		    main3_ .clo6v[jj * 3 - 2] = main3_ .clo6v[jj1 * 3 - 2];
		    main3_ .clo6v[jj * 3 - 1] = main3_ .clo6v[jj1 * 3 - 1];
		    main3_ .clop6v[jj * 3 - 3] = main3_ .clop6v[jj1 * 3 - 3];
		    main3_ .clop6v[jj * 3 - 2] = main3_ .clop6v[jj1 * 3 - 2];
		    main3_ .clop6v[jj * 3 - 1] = main3_ .clop6v[jj1 * 3 - 1];
 
		    if (beam_ .nbeam >= 1) {
			for (jjj = 1; jjj <= 700; ++jjj) {
			    if (ell_ .kz[jjj - 1] == 20) {
				beam_ .clobeam[(jj + (jjj << 6) << 1) - 130] =
					 beam_ .clobeam[(jj1 + (jjj << 6) << 
					1) - 130];
				beam_ .clobeam[(jj + (jjj << 6) << 1) - 129] =
					 beam_ .clobeam[(jj1 + (jjj << 6) << 
					1) - 129];
				beam_ .sigman[(jj + (jjj << 6) << 1) - 130] = 
					beam_ .sigman[(jj1 + (jjj << 6) << 1) 
					- 130];
				beam_ .sigman[(jj + (jjj << 6) << 1) - 129] = 
					beam_ .sigman[(jj1 + (jjj << 6) << 1) 
					- 129];
				beam_ .sigman2[(jj + (jjj << 6) << 1) - 130] =
					 beam_ .sigman2[(jj1 + (jjj << 6) << 
					1) - 130];
				beam_ .sigman2[(jj + (jjj << 6) << 1) - 129] =
					 beam_ .sigman2[(jj1 + (jjj << 6) << 
					1) - 129];
				beam_ .sigmanq[(jj + (jjj << 6) << 1) - 130] =
					 beam_ .sigmanq[(jj1 + (jjj << 6) << 
					1) - 130];
				beam_ .sigmanq[(jj + (jjj << 6) << 1) - 129] =
					 beam_ .sigmanq[(jj1 + (jjj << 6) << 
					1) - 129];
				beam_ .beamoff[(jj + (jjj << 6) << 1) - 130] =
					 beam_ .beamoff[(jj1 + (jjj << 6) << 
					1) - 130];
				beam_ .beamoff[(jj + (jjj << 6) << 1) - 129] =
					 beam_ .beamoff[(jj1 + (jjj << 6) << 
					1) - 129];
			    }
 
			}
		    }
		    main3_ .di0xs[jj - 1] = main3_ .di0xs[jj1 - 1];
		    main3_ .dip0xs[jj - 1] = main3_ .dip0xs[jj1 - 1];
		    main3_ .di0zs[jj - 1] = main3_ .di0zs[jj1 - 1];
		    main3_ .dip0zs[jj - 1] = main3_ .dip0zs[jj1 - 1];
		    for (ib2 = 1; ib2 <= 6; ++ib2) {
			for (ib3 = 1; ib3 <= 6; ++ib3) {
			    main3_ .tasau[jj + (ib2 + ib3 * 6 << 6) - 449] = 
				    main3_ .tasau[jj1 + (ib2 + ib3 * 6 << 6) 
				    - 449];
 
			}
		    }
 
		}
	    }
	    --lnapx;
	}
 
    }
    if (lnapx == 0) {
	s_wsle(&io___2704);
	e_wsle();
	s_wsle(&io___2705);
	e_wsle();
	s_wsle(&io___2706);
	do_lio(&c__9, &c__1, "***********************", 23L);
	e_wsle();
	s_wsle(&io___2707);
	do_lio(&c__9, &c__1, "** ALL PARTICLE LOST **", 23L);
	e_wsle();
	s_wsle(&io___2708);
	do_lio(&c__9, &c__1, "**   PROGRAM STOPS   **", 23L);
	e_wsle();
	s_wsle(&io___2709);
	do_lio(&c__9, &c__1, "***********************", 23L);
	e_wsle();
	s_wsle(&io___2710);
	e_wsle();
	s_wsle(&io___2711);
	e_wsle();
	*nthinerr = 3001;
	return 0;
    }
    if (tit_ .ithick == 1 && ilostch == 1) {
	synuthck_();
    }
    tra1_ .napx = lnapx;
    return 0;
}  

 
 
  int lostpar3_(i__, ix, nthinerr)
integer *i__, *ix, *nthinerr;
{
     
    static char fmt_10000[] = "(\002 \002/t10,\002TRACKING ENDED ABNORMALLY\002/t10,\002PARTICLE \002,i3,\002 RANDOM SEED \002,i8,\002 MOMENTUM DEVIATION \002,g12.5/t10,\002 LOST IN REVOLUTION \002,i8,\002 AT ELEMENT \002,i4/t10,\002HORIZ:  AMPLITUDE = \002,f15.3,\002   APERTURE = \002,f15.3/t10,\002VERT:   AMPLITUDE = \002,f15.3,\002   APERTURE = \002,f15.3/t10,\002ELEMENT - LIST NUMBER \002,i4,\002 TYP NUMBER \002,i4,\002 NAME \002,a16/)";

     
    integer i__1, i__2;
    doublereal d__1, d__2, d__3, d__4;

     
    integer s_wsfe(), do_fio(), e_wsfe(), s_wsle(), e_wsle(), do_lio();

     
    extern   int synuthck_();
    static integer j, jj, ib2, ib3, jj1, lnapx, jjj, ilostch;

     
    static cilist io___2714 = { 0, 6, 0, fmt_10000, 0 };
    static cilist io___2715 = { 0, 6, 0, fmt_10000, 0 };
    static cilist io___2722 = { 0, 6, 0, 0, 0 };
    static cilist io___2723 = { 0, 6, 0, 0, 0 };
    static cilist io___2724 = { 0, 6, 0, 0, 0 };
    static cilist io___2725 = { 0, 6, 0, 0, 0 };
    static cilist io___2726 = { 0, 6, 0, 0, 0 };
    static cilist io___2727 = { 0, 6, 0, 0, 0 };
    static cilist io___2728 = { 0, 6, 0, 0, 0 };
    static cilist io___2729 = { 0, 6, 0, 0, 0 };


 


 
 

 
 

    ilostch = 0;
    i__1 = tra1_ .napx;
    for (j = 1; j <= i__1; ++j) {
	if ((d__1 = main1_ .xv[(j << 1) - 2], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > apert_ .apx[*ix - 
		1] || (d__2 = main1_ .xv[(j << 1) - 1], (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) ) > 
		apert_ .apz[*ix - 1] || main1_ .xv[(j << 1) - 2] != 
		main1_ .xv[(j << 1) - 2] || main1_ .xv[(j << 1) - 1] != 
		main1_ .xv[(j << 1) - 1]) {
	    ilostch = 1;
	    main1_ .pstop[main1_ .nlostp[j - 1] - 1] = (1) ;
	}
 
    }
    i__1 = tra1_ .napx;
    for (j = 1; j <= i__1; ++j) {
	if (main1_ .pstop[main1_ .nlostp[j - 1] - 1]) {
	    main2_ .aperv[main1_ .nlostp[j - 1] - 1] = apert_ .apx[*ix - 1];
	    main2_ .aperv[main1_ .nlostp[j - 1] + 63] = apert_ .apz[*ix - 1];
	    main2_ .iv[main1_ .nlostp[j - 1] - 1] = *i__;
	    main2_ .ixv[main1_ .nlostp[j - 1] - 1] = *ix;
	    main2_ .xvl[(main1_ .nlostp[j - 1] << 1) - 2] = main1_ .xv[(j << 
		    1) - 2];
	    main2_ .xvl[(main1_ .nlostp[j - 1] << 1) - 1] = main1_ .xv[(j << 
		    1) - 1];
	    main2_ .yvl[(main1_ .nlostp[j - 1] << 1) - 2] = main1_ .yv[(j << 
		    1) - 2];
	    main2_ .yvl[(main1_ .nlostp[j - 1] << 1) - 1] = main1_ .yv[(j << 
		    1) - 1];
	    main2_ .dpsvl[main1_ .nlostp[j - 1] - 1] = main1_ .dpsv[j - 1];
	    main2_ .ejvl[main1_ .nlostp[j - 1] - 1] = main1_ .ejv[j - 1];
	    main2_ .sigmvl[main1_ .nlostp[j - 1] - 1] = main1_ .sigmv[j - 1];
	    main1_ .numxv[main1_ .nlostp[j - 1] - 1] = main4_ .numx;
	    postr2_ .nnumxv[main1_ .nlostp[j - 1] - 1] = main4_ .numx;
	    if ((doublereal) (main1_ .nlostp[j - 1] % 2) == 1.) {
		s_wsfe(&io___2714);
		do_fio(&c__1, (char *)& main1_ .nlostp[j - 1], (ftnlen)sizeof(
			integer));
		i__2 = main1_ .nms[main1_ .nlostp[j - 1] - 1] * rand0_ .izu0;
		do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)& main1_ .dp0v[main1_ .nlostp[j - 1] - 1]
			, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& main1_ .numxv[main1_ .nlostp[j - 1] - 
			1], (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)& main2_ .iv[main1_ .nlostp[j - 1] - 1], 
			(ftnlen)sizeof(integer));
		d__2 = (d__1 = main2_ .xvl[(main1_ .nlostp[j - 1] << 1) - 2], 
			(( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
		do_fio(&c__1, (char *)&d__2, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& main2_ .aperv[main1_ .nlostp[j - 1] - 
			1], (ftnlen)sizeof(doublereal));
		d__4 = (d__3 = main2_ .xvl[(main1_ .nlostp[j - 1] << 1) - 1], 
			(( d__3 ) >= 0 ? ( d__3 ) : -( d__3 )) );
		do_fio(&c__1, (char *)&d__4, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& main2_ .aperv[main1_ .nlostp[j - 1] + 
			63], (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& main2_ .ixv[main1_ .nlostp[j - 1] - 1],
			 (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)& ell_ .kz[main2_ .ixv[main1_ .nlostp[j 
			- 1] - 1] - 1], (ftnlen)sizeof(integer));
		do_fio(&c__1, linopc_ .bez + (main2_ .ixv[main1_ .nlostp[j - 
			1] - 1] - 1 << 4), 16L);
		e_wsfe();
	    } else {
		s_wsfe(&io___2715);
		do_fio(&c__1, (char *)& main1_ .nlostp[j - 1], (ftnlen)sizeof(
			integer));
		i__2 = main1_ .nms[main1_ .nlostp[j - 1] - 2] * rand0_ .izu0;
		do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)& main1_ .dp0v[main1_ .nlostp[j - 1] - 2]
			, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& main1_ .numxv[main1_ .nlostp[j - 1] - 
			1], (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)& main2_ .iv[main1_ .nlostp[j - 1] - 1], 
			(ftnlen)sizeof(integer));
		d__2 = (d__1 = main2_ .xvl[(main1_ .nlostp[j - 1] << 1) - 2], 
			(( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
		do_fio(&c__1, (char *)&d__2, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& main2_ .aperv[main1_ .nlostp[j - 1] - 
			1], (ftnlen)sizeof(doublereal));
		d__4 = (d__3 = main2_ .xvl[(main1_ .nlostp[j - 1] << 1) - 1], 
			(( d__3 ) >= 0 ? ( d__3 ) : -( d__3 )) );
		do_fio(&c__1, (char *)&d__4, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& main2_ .aperv[main1_ .nlostp[j - 1] + 
			63], (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& main2_ .ixv[main1_ .nlostp[j - 1] - 1],
			 (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)& ell_ .kz[main2_ .ixv[main1_ .nlostp[j 
			- 1] - 1] - 1], (ftnlen)sizeof(integer));
		do_fio(&c__1, linopc_ .bez + (main2_ .ixv[main1_ .nlostp[j - 
			1] - 1] - 1 << 4), 16L);
		e_wsfe();
	    }
	}
 
    }
    lnapx = tra1_ .napx;
    for (j = tra1_ .napx; j >= 1; --j) {
	if (main1_ .pstop[main1_ .nlostp[j - 1] - 1]) {
	    if (j != lnapx) {
		i__1 = lnapx - 1;
		for (jj = j; jj <= i__1; ++jj) {
		    jj1 = jj + 1;
		    main1_ .nlostp[jj - 1] = main1_ .nlostp[jj1 - 1];
		    main1_ .xv[(jj << 1) - 2] = main1_ .xv[(jj1 << 1) - 2];
		    main1_ .xv[(jj << 1) - 1] = main1_ .xv[(jj1 << 1) - 1];
		    main1_ .yv[(jj << 1) - 2] = main1_ .yv[(jj1 << 1) - 2];
		    main1_ .yv[(jj << 1) - 1] = main1_ .yv[(jj1 << 1) - 1];
		    main1_ .dpsv[jj - 1] = main1_ .dpsv[jj1 - 1];
		    main1_ .sigmv[jj - 1] = main1_ .sigmv[jj1 - 1];
		    main1_ .ejfv[jj - 1] = main1_ .ejfv[jj1 - 1];
		    main1_ .ejv[jj - 1] = main1_ .ejv[jj1 - 1];
		    main1_ .rvv[jj - 1] = main1_ .rvv[jj1 - 1];
		    main2_ .oidpsv[jj - 1] = main2_ .oidpsv[jj1 - 1];
		    track_ .dpsv1[jj - 1] = track_ .dpsv1[jj1 - 1];
		    main3_ .clo6v[jj * 3 - 3] = main3_ .clo6v[jj1 * 3 - 3];
		    main3_ .clo6v[jj * 3 - 2] = main3_ .clo6v[jj1 * 3 - 2];
		    main3_ .clo6v[jj * 3 - 1] = main3_ .clo6v[jj1 * 3 - 1];
		    main3_ .clop6v[jj * 3 - 3] = main3_ .clop6v[jj1 * 3 - 3];
		    main3_ .clop6v[jj * 3 - 2] = main3_ .clop6v[jj1 * 3 - 2];
		    main3_ .clop6v[jj * 3 - 1] = main3_ .clop6v[jj1 * 3 - 1];
 
		    if (beam_ .nbeam >= 1) {
			for (jjj = 1; jjj <= 700; ++jjj) {
			    if (ell_ .kz[jjj - 1] == 20) {
				beam_ .clobeam[(jj + (jjj << 6) << 1) - 130] =
					 beam_ .clobeam[(jj1 + (jjj << 6) << 
					1) - 130];
				beam_ .clobeam[(jj + (jjj << 6) << 1) - 129] =
					 beam_ .clobeam[(jj1 + (jjj << 6) << 
					1) - 129];
				beam_ .sigman[(jj + (jjj << 6) << 1) - 130] = 
					beam_ .sigman[(jj1 + (jjj << 6) << 1) 
					- 130];
				beam_ .sigman[(jj + (jjj << 6) << 1) - 129] = 
					beam_ .sigman[(jj1 + (jjj << 6) << 1) 
					- 129];
				beam_ .sigman2[(jj + (jjj << 6) << 1) - 130] =
					 beam_ .sigman2[(jj1 + (jjj << 6) << 
					1) - 130];
				beam_ .sigman2[(jj + (jjj << 6) << 1) - 129] =
					 beam_ .sigman2[(jj1 + (jjj << 6) << 
					1) - 129];
				beam_ .sigmanq[(jj + (jjj << 6) << 1) - 130] =
					 beam_ .sigmanq[(jj1 + (jjj << 6) << 
					1) - 130];
				beam_ .sigmanq[(jj + (jjj << 6) << 1) - 129] =
					 beam_ .sigmanq[(jj1 + (jjj << 6) << 
					1) - 129];
				beam_ .beamoff[(jj + (jjj << 6) << 1) - 130] =
					 beam_ .beamoff[(jj1 + (jjj << 6) << 
					1) - 130];
				beam_ .beamoff[(jj + (jjj << 6) << 1) - 129] =
					 beam_ .beamoff[(jj1 + (jjj << 6) << 
					1) - 129];
			    }
 
			}
		    }
		    main3_ .di0xs[jj - 1] = main3_ .di0xs[jj1 - 1];
		    main3_ .dip0xs[jj - 1] = main3_ .dip0xs[jj1 - 1];
		    main3_ .di0zs[jj - 1] = main3_ .di0zs[jj1 - 1];
		    main3_ .dip0zs[jj - 1] = main3_ .dip0zs[jj1 - 1];
		    for (ib2 = 1; ib2 <= 6; ++ib2) {
			for (ib3 = 1; ib3 <= 6; ++ib3) {
			    main3_ .tasau[jj + (ib2 + ib3 * 6 << 6) - 449] = 
				    main3_ .tasau[jj1 + (ib2 + ib3 * 6 << 6) 
				    - 449];
 
			}
		    }
 
		}
	    }
	    --lnapx;
	}
 
    }
    if (lnapx == 0) {
	s_wsle(&io___2722);
	e_wsle();
	s_wsle(&io___2723);
	e_wsle();
	s_wsle(&io___2724);
	do_lio(&c__9, &c__1, "***********************", 23L);
	e_wsle();
	s_wsle(&io___2725);
	do_lio(&c__9, &c__1, "** ALL PARTICLE LOST **", 23L);
	e_wsle();
	s_wsle(&io___2726);
	do_lio(&c__9, &c__1, "**   PROGRAM STOPS   **", 23L);
	e_wsle();
	s_wsle(&io___2727);
	do_lio(&c__9, &c__1, "***********************", 23L);
	e_wsle();
	s_wsle(&io___2728);
	e_wsle();
	s_wsle(&io___2729);
	e_wsle();
	*nthinerr = 3001;
	return 0;
    }
    if (tit_ .ithick == 1 && ilostch == 1) {
	synuthck_();
    }
    tra1_ .napx = lnapx;
    return 0;
}  

 
 
  int lostpart_(nthinerr)
integer *nthinerr;
{
     
    static char fmt_10000[] = "(\002 \002/t10,\002TRACKING ENDED ABNORMALLY\002/t10,\002PARTICLE \002,i3,\002 RANDOM SEED \002,i8,/t10,\002 MOMENTUM DEVIATION \002,g12.5,\002 LOST IN REVOLUTION \002,i8,/t10,\002HORIZ:  AMPLITUDE = \002,f15.3,\002   APERTURE = \002,f15.3/t10,\002VERT:   AMPLITUDE = \002,f15.3,\002   APERTURE = \002,f15.3/)";

     
    integer i__1, i__2;
    doublereal d__1, d__2, d__3, d__4;

     
    integer s_wsfe(), do_fio(), e_wsfe(), s_wsle(), e_wsle(), do_lio();

     
    extern   int synuthck_();
    static integer j, jj, ib2, ib3, jj1, lnapx, jjj, ilostch;

     
    static cilist io___2732 = { 0, 6, 0, fmt_10000, 0 };
    static cilist io___2733 = { 0, 6, 0, fmt_10000, 0 };
    static cilist io___2740 = { 0, 6, 0, 0, 0 };
    static cilist io___2741 = { 0, 6, 0, 0, 0 };
    static cilist io___2742 = { 0, 6, 0, 0, 0 };
    static cilist io___2743 = { 0, 6, 0, 0, 0 };
    static cilist io___2744 = { 0, 6, 0, 0, 0 };
    static cilist io___2745 = { 0, 6, 0, 0, 0 };
    static cilist io___2746 = { 0, 6, 0, 0, 0 };
    static cilist io___2747 = { 0, 6, 0, 0, 0 };


 


 
 

 
 

    ilostch = 0;
    i__1 = tra1_ .napx;
    for (j = 1; j <= i__1; ++j) {
	if ((d__1 = main1_ .xv[(j << 1) - 2], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > beo_ .aper[0] || (
		d__2 = main1_ .xv[(j << 1) - 1], (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) ) > beo_ .aper[1] ||
		 main1_ .xv[(j << 1) - 2] != main1_ .xv[(j << 1) - 2] || 
		main1_ .xv[(j << 1) - 1] != main1_ .xv[(j << 1) - 1]) {
	    ilostch = 1;
	    main1_ .pstop[main1_ .nlostp[j - 1] - 1] = (1) ;
	}
 
    }
    i__1 = tra1_ .napx;
    for (j = 1; j <= i__1; ++j) {
	if (main1_ .pstop[main1_ .nlostp[j - 1] - 1]) {
	    main2_ .aperv[main1_ .nlostp[j - 1] - 1] = beo_ .aper[0];
	    main2_ .aperv[main1_ .nlostp[j - 1] + 63] = beo_ .aper[1];
	    main2_ .xvl[(main1_ .nlostp[j - 1] << 1) - 2] = main1_ .xv[(j << 
		    1) - 2];
	    main2_ .xvl[(main1_ .nlostp[j - 1] << 1) - 1] = main1_ .xv[(j << 
		    1) - 1];
	    main2_ .yvl[(main1_ .nlostp[j - 1] << 1) - 2] = main1_ .yv[(j << 
		    1) - 2];
	    main2_ .yvl[(main1_ .nlostp[j - 1] << 1) - 1] = main1_ .yv[(j << 
		    1) - 1];
	    main2_ .dpsvl[main1_ .nlostp[j - 1] - 1] = main1_ .dpsv[j - 1];
	    main2_ .ejvl[main1_ .nlostp[j - 1] - 1] = main1_ .ejv[j - 1];
	    main2_ .sigmvl[main1_ .nlostp[j - 1] - 1] = main1_ .sigmv[j - 1];
	    main1_ .numxv[main1_ .nlostp[j - 1] - 1] = main4_ .numx;
	    postr2_ .nnumxv[main1_ .nlostp[j - 1] - 1] = main4_ .numx;
	    if ((doublereal) (main1_ .nlostp[j - 1] % 2) == 1.) {
		s_wsfe(&io___2732);
		do_fio(&c__1, (char *)& main1_ .nlostp[j - 1], (ftnlen)sizeof(
			integer));
		i__2 = main1_ .nms[main1_ .nlostp[j - 1] - 1] * rand0_ .izu0;
		do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)& main1_ .dp0v[main1_ .nlostp[j - 1] - 1]
			, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& main1_ .numxv[main1_ .nlostp[j - 1] - 
			1], (ftnlen)sizeof(integer));
		d__2 = (d__1 = main2_ .xvl[(main1_ .nlostp[j - 1] << 1) - 2], 
			(( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
		do_fio(&c__1, (char *)&d__2, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& main2_ .aperv[main1_ .nlostp[j - 1] - 
			1], (ftnlen)sizeof(doublereal));
		d__4 = (d__3 = main2_ .xvl[(main1_ .nlostp[j - 1] << 1) - 1], 
			(( d__3 ) >= 0 ? ( d__3 ) : -( d__3 )) );
		do_fio(&c__1, (char *)&d__4, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& main2_ .aperv[main1_ .nlostp[j - 1] + 
			63], (ftnlen)sizeof(doublereal));
		e_wsfe();
	    } else {
		s_wsfe(&io___2733);
		do_fio(&c__1, (char *)& main1_ .nlostp[j - 1], (ftnlen)sizeof(
			integer));
		i__2 = main1_ .nms[main1_ .nlostp[j - 1] - 2] * rand0_ .izu0;
		do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)& main1_ .dp0v[main1_ .nlostp[j - 1] - 2]
			, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& main1_ .numxv[main1_ .nlostp[j - 1] - 
			1], (ftnlen)sizeof(integer));
		d__2 = (d__1 = main2_ .xvl[(main1_ .nlostp[j - 1] << 1) - 2], 
			(( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
		do_fio(&c__1, (char *)&d__2, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& main2_ .aperv[main1_ .nlostp[j - 1] - 
			1], (ftnlen)sizeof(doublereal));
		d__4 = (d__3 = main2_ .xvl[(main1_ .nlostp[j - 1] << 1) - 1], 
			(( d__3 ) >= 0 ? ( d__3 ) : -( d__3 )) );
		do_fio(&c__1, (char *)&d__4, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& main2_ .aperv[main1_ .nlostp[j - 1] + 
			63], (ftnlen)sizeof(doublereal));
		e_wsfe();
	    }
	}
 
    }
    lnapx = tra1_ .napx;
    for (j = tra1_ .napx; j >= 1; --j) {
	if (main1_ .pstop[main1_ .nlostp[j - 1] - 1]) {
	    if (j != lnapx) {
		i__1 = lnapx - 1;
		for (jj = j; jj <= i__1; ++jj) {
		    jj1 = jj + 1;
		    main1_ .nlostp[jj - 1] = main1_ .nlostp[jj1 - 1];
		    main1_ .xv[(jj << 1) - 2] = main1_ .xv[(jj1 << 1) - 2];
		    main1_ .xv[(jj << 1) - 1] = main1_ .xv[(jj1 << 1) - 1];
		    main1_ .yv[(jj << 1) - 2] = main1_ .yv[(jj1 << 1) - 2];
		    main1_ .yv[(jj << 1) - 1] = main1_ .yv[(jj1 << 1) - 1];
		    main1_ .dpsv[jj - 1] = main1_ .dpsv[jj1 - 1];
		    main1_ .sigmv[jj - 1] = main1_ .sigmv[jj1 - 1];
		    main1_ .ejfv[jj - 1] = main1_ .ejfv[jj1 - 1];
		    main1_ .ejv[jj - 1] = main1_ .ejv[jj1 - 1];
		    main1_ .rvv[jj - 1] = main1_ .rvv[jj1 - 1];
		    main2_ .oidpsv[jj - 1] = main2_ .oidpsv[jj1 - 1];
		    track_ .dpsv1[jj - 1] = track_ .dpsv1[jj1 - 1];
		    main3_ .clo6v[jj * 3 - 3] = main3_ .clo6v[jj1 * 3 - 3];
		    main3_ .clo6v[jj * 3 - 2] = main3_ .clo6v[jj1 * 3 - 2];
		    main3_ .clo6v[jj * 3 - 1] = main3_ .clo6v[jj1 * 3 - 1];
		    main3_ .clop6v[jj * 3 - 3] = main3_ .clop6v[jj1 * 3 - 3];
		    main3_ .clop6v[jj * 3 - 2] = main3_ .clop6v[jj1 * 3 - 2];
		    main3_ .clop6v[jj * 3 - 1] = main3_ .clop6v[jj1 * 3 - 1];
 
		    if (beam_ .nbeam >= 1) {
			for (jjj = 1; jjj <= 700; ++jjj) {
			    if (ell_ .kz[jjj - 1] == 20) {
				beam_ .clobeam[(jj + (jjj << 6) << 1) - 130] =
					 beam_ .clobeam[(jj1 + (jjj << 6) << 
					1) - 130];
				beam_ .clobeam[(jj + (jjj << 6) << 1) - 129] =
					 beam_ .clobeam[(jj1 + (jjj << 6) << 
					1) - 129];
				beam_ .sigman[(jj + (jjj << 6) << 1) - 130] = 
					beam_ .sigman[(jj1 + (jjj << 6) << 1) 
					- 130];
				beam_ .sigman[(jj + (jjj << 6) << 1) - 129] = 
					beam_ .sigman[(jj1 + (jjj << 6) << 1) 
					- 129];
				beam_ .sigman2[(jj + (jjj << 6) << 1) - 130] =
					 beam_ .sigman2[(jj1 + (jjj << 6) << 
					1) - 130];
				beam_ .sigman2[(jj + (jjj << 6) << 1) - 129] =
					 beam_ .sigman2[(jj1 + (jjj << 6) << 
					1) - 129];
				beam_ .sigmanq[(jj + (jjj << 6) << 1) - 130] =
					 beam_ .sigmanq[(jj1 + (jjj << 6) << 
					1) - 130];
				beam_ .sigmanq[(jj + (jjj << 6) << 1) - 129] =
					 beam_ .sigmanq[(jj1 + (jjj << 6) << 
					1) - 129];
				beam_ .beamoff[(jj + (jjj << 6) << 1) - 130] =
					 beam_ .beamoff[(jj1 + (jjj << 6) << 
					1) - 130];
				beam_ .beamoff[(jj + (jjj << 6) << 1) - 129] =
					 beam_ .beamoff[(jj1 + (jjj << 6) << 
					1) - 129];
			    }
 
			}
		    }
		    main3_ .di0xs[jj - 1] = main3_ .di0xs[jj1 - 1];
		    main3_ .dip0xs[jj - 1] = main3_ .dip0xs[jj1 - 1];
		    main3_ .di0zs[jj - 1] = main3_ .di0zs[jj1 - 1];
		    main3_ .dip0zs[jj - 1] = main3_ .dip0zs[jj1 - 1];
		    for (ib2 = 1; ib2 <= 6; ++ib2) {
			for (ib3 = 1; ib3 <= 6; ++ib3) {
			    main3_ .tasau[jj + (ib2 + ib3 * 6 << 6) - 449] = 
				    main3_ .tasau[jj1 + (ib2 + ib3 * 6 << 6) 
				    - 449];
 
			}
		    }
 
		}
	    }
	    --lnapx;
	}
 
    }
    if (lnapx == 0) {
	s_wsle(&io___2740);
	e_wsle();
	s_wsle(&io___2741);
	e_wsle();
	s_wsle(&io___2742);
	do_lio(&c__9, &c__1, "***********************", 23L);
	e_wsle();
	s_wsle(&io___2743);
	do_lio(&c__9, &c__1, "** ALL PARTICLE LOST **", 23L);
	e_wsle();
	s_wsle(&io___2744);
	do_lio(&c__9, &c__1, "**   PROGRAM STOPS   **", 23L);
	e_wsle();
	s_wsle(&io___2745);
	do_lio(&c__9, &c__1, "***********************", 23L);
	e_wsle();
	s_wsle(&io___2746);
	e_wsle();
	s_wsle(&io___2747);
	e_wsle();
	*nthinerr = 3001;
	return 0;
    }
    if (tit_ .ithick == 1 && ilostch == 1) {
	synuthck_();
    }
    tra1_ .napx = lnapx;
    return 0;
}  

  MAIN__()
{

     
    static char fmt_10010[] = "(\002 \002/t10,\002SIXTRACK VECTOR VERSION 2 (with tilt)\002,\002  --  (last change: 17.02.1998)\002//)";
    static char fmt_10030[] = "(\002 \002/t10,\002STRUCTURE INPUT FILE HAS -THICK- LINEAR \002,\002ELEMENTS\002//)";
    static char fmt_10040[] = "(\002 \002/t10,\002STRUCTURE INPUT FILE HAS ONLY -THIN- LINEAR \002,\002ELEMENTS\002//)";
    static char fmt_10025[] = "(\002 \002/t10,\002Run started from binary dump file # 32\002)";
    static char fmt_10320[] = "(//131(\002-\002)//t10,\002DATA BLOCK FLUCTUATIONS OF MULTIPOLES\002//t10,\002RANDOM STARTING NUMBER=  \002,i20/t10,\002RANDOM NUMBERS GENERATED:\002,i20/t10,\002MEAN VALUE=\002,f15.7,\002  -   DEVIATION=\002,f15.7)";
    static char fmt_10070[] = "(\002 \002/131(\002-\002))";
    static char fmt_10130[] = "(/t10,\002 SIX-DIMENSIONAL CLOSED ORBIT CALCULATED\002/t10,\002FOR SEED NUMBER = \002,i1)";
    static char fmt_10140[] = "(1x,f47.33/1x,f47.33)";
    static char fmt_10340[] = "(//131(\002-\002)//t10,\0026D TUNE-VARIATION\002//t10,\002TUNE\002,26x,\002THEORET.       AFTER CORRECTION\002/t10,\002HORIZONTAL\002,15x,g20.14,g20.14/t10,\002VERTICAL\002,17x,g20.14,g20.14//t10,\002ITERATION:\002,21x,i3/t10,\002ACCURACY:\002,17x,g16.10/)";
    static char fmt_10350[] = "(t10,\002QUADRU.STRENGTHS\002,7x,g16.10,2x,g16.10,\002   TYP     \002,a16/t10,23x,g16.10,2x,g16.10,\002           \002,a16)";
    static char fmt_10230[] = "(t10,\002NO OPTICAL SOLUTION FOR\002,2x,f19.16,2x,\002RELATIVE MOMENTUM DEVIATION\002)";
    static char fmt_10170[] = "(/t10,\002TRACKING FOR CONSTANT MOMENTUM DEVIATION\002//15x,\002------ NO ACCELERATION ------\002//t15,\002       TUNE         CLO            CLOP           \002,\002   BET0           ALF0           GAMMA      \002//t10,\002  X  \002,f14.10,2(1x,g14.8),1x,f15.9,1x,f15.10,f15.9/t60,f15.9,1x,f15.10,f15.9/t10,\002  Z  \002,f14.10,2(1x,g14.8),1x,f15.9,1x,f15.10,f15.9/t60,f15.9,1x,f15.10,f15.9/)";
    static char fmt_10150[] = "(/t10,\002TRACKING WITH SYNCHROTRON OSCILLATIONS\002/15x,\002ACCELERATION WITH PHASE = \002,f8.4/t15,\002       TUNE         CLO            CLOP           \002,\002   BET0           ALF0           GAMMA      \002//t10,\002  X  \002,f14.10,2(1x,g14.8),1x,f15.9,1x,f15.10,f15.9/t60,f15.9,1x,f15.10,f15.9/t10,\002  Z  \002,f14.10,2(1x,g14.8),1x,f15.9,1x,f15.10,f15.9/t60,f15.9,1x,f15.10,f15.9,f15.9/)";
    static char fmt_10160[] = "(/t10,\002TRACKING WITH SYNCHROTRON OSCILLATIONS\002/15x,\002ACCELERATION WITH PHASE = \002,f8.4/t15,\002       TUNE         CLO            CLOP           \002,\002   BET0           ALF0           GAMMA      \002//t10,\002  X  \002,f14.10,2(1x,g14.8),1x,f15.9,1x,f15.10,f15.9/t60,f15.9,1x,f15.10,f15.9/t60,f15.9,1x,f15.10,f15.9/t10,\002  Z  \002,f14.10,2(1x,g14.8),1x,f15.9,1x,f15.10,f15.9/t60,f15.9,1x,f15.10,f15.9/t60,f15.9,1x,f15.10,f15.9/t10,\002  S  \002,f14.10,2(1x,g14.8),1x,f15.7,1x,f15.10,f15.9/t60,f15.9,1x,f15.10,f15.9/t60,f15.9,1x,f15.10,f15.9/)";
    static char fmt_10190[] = "(t10,\002TRACKING FOR CONSTANT MOMENTUM DEVIATION\002//15x,\002ACCELERATION WITH PHASE = \002,f8.4/t15,\002       TUNE         CLO            CLOP           \002,\002   BET0           ALF0           GAMMA      \002//t10,\002  X  \002,f14.10,2(1x,g14.8),1x,f15.9,1x,f15.10,f15.9/t60,f15.9,1x,f15.10,f15.9/t10,\002  Z  \002,f14.10,2(1x,g14.8),1x,f15.9,1x,f15.10,f15.9/t60,f15.9,1x,f15.10,f15.9/)";
    static char fmt_10210[] = "(/t10,\002TRACKING WITH SYNCHROTRON OSCILLATIONS\002/15x,\002------ NO ACCELERATION ------\002//t15,\002       TUNE         CLO            CLOP           \002,\002   BET0           ALF0           GAMMA      \002//t10,\002  X  \002,f14.10,2(1x,g14.8),1x,f15.9,1x,f15.10,f15.9/t60,f15.9,1x,f15.10,f15.9/t10,\002  Z  \002,f14.10,2(1x,g14.8),1x,f15.9,1x,f15.10,f15.9/t60,f15.9,1x,f15.10,f15.9/)";
    static char fmt_10220[] = "(/t10,\002TRACKING WITH SYNCHROTRON OSCILLATIONS\002/15x,\002------ NO ACCELERATION ------\002//t15,\002       TUNE         CLO            CLOP           \002,\002   BET0           ALF0           GAMMA      \002//t10,\002  X  \002,f14.10,2(1x,g14.8),1x,f15.9,1x,f15.10,f15.9/t60,f15.9,1x,f15.10,f15.9/t60,f15.9,1x,f15.10,f15.9/t10,\002  Z  \002,f14.10,2(1x,g14.8),1x,f15.9,1x,f15.10,f15.9/t60,f15.9,1x,f15.10,f15.9/t60,f15.9,1x,f15.10,f15.9/t10,\002  S  \002,f14.10,2(1x,g14.8),1x,f15.7,1x,f15.10,f15.9/t60,f15.9,1x,f15.10,f15.9/t60,f15.9,1x,f15.10,f15.9/)";
    static char fmt_10080[] = "(\002 \002/t10,\002REL. MOMENTUM DEVIATION=\002,f19.16/t8,\002========================================\002)";
    static char fmt_10110[] = "(/5x,\002---- CLOSED ORBIT AND DECOUPLING (1=COU,0=DECOU)\002/5x,\002/CLX /\002,f47.33/5x,\002/CLXP/\002,f47.33/5x,\002/CLZ /\002,f47.33/5x,\002/CLZP/\002,f47.33/5x,\002/DCX / \002,i4/5x,\002/DCZ / \002,i4/5x,\002/IVER /\002,i4/5x,\002/IDFOR/\002,i4/5x,\002/ICLO6/\002,i4/5x,\002/ITION/\002,i4/5x/)";
    static char fmt_10120[] = "(/5x,\002---- CLOSED ORBIT AND DECOUPLING (1=COU,0=DECOU)\002/5x,\002/CLX /\002,f47.33/5x,\002/CLXP/\002,f47.33/5x,\002/CLZ /\002,f47.33/5x,\002/CLZP/\002,f47.33/5x,\002/CLS /\002,f47.33/5x,\002/CLSP/\002,f47.33/5x,\002/DCX / \002,i4/5x,\002/DCZ / \002,i4/5x,\002/IVER /\002,i4/5x,\002/IDFOR/\002,i4/5x,\002/ICLO6/\002,i4/5x,\002/ITION/\002,i4/5x/)";
    static char fmt_10050[] = "(//131(\002-\002)//t10,27(\002o\002)/t10,2(\002o\002),23x,2(\002o\002)/t10,\002OO  INITIAL COORDINATES  OO\002/t10,2(\002o\002),23x,2(\002o\002)/t10,27(\002o\002)//131(\002-\002)//)";
    static char fmt_10260[] = "(1x/5x,\002PARTICLE \002,i3,\002 RANDOM SEED \002,i8,\002 MOMENTUM DEVIATION \002,g12.5/)";
    static char fmt_10060[] = "(/5x,\002---- TWIN-TRAJECTORIES NO CL.ORBIT ADDED\002/5x,\002/X1  /\002,f47.33/5x,\002/XP1 /\002,f47.33/5x,\002/Z1  /\002,f47.33/5x,\002/ZP1 /\002,f47.33/5x,\002/SIG1/\002,f47.33/5x,\002/DP1 /\002,f47.33/5x,\002/X2  /\002,f47.33/5x,\002/XP2 /\002,f47.33/5x,\002/Z2  /\002,f47.33/5x,\002/ZP2 /\002,f47.33/5x,\002/SIG2/\002,f47.33/5x,\002/DP2 /\002,f47.33/)";
    static char fmt_10020[] = "(\002 \002/t10,\002UNCOUPLED AMPLITUDES AND EMITTANCES:\002,/t10,\002AMPLITUDE-X = \002,f15.3,10x,\002AMPLITUDE-Z = \002,f15.3,\002  MM\002/t10,\002EMITTANCE-X = \002,f15.3,10x,\002EMITTANCE-Z = \002,f15.3,\002  PI*MRAD*MM\002)";
    static char fmt_10090[] = "(/5x,\002---- INITIAL COORD. OF TWIN-TRAJECTORIES\002/15(10x,f47.33/))";
    static char fmt_10200[] = "(//131(\002-\002)//t10,16(\002o\002)/t10,2(\002o\002),12x,2(\002o\002)/t10,\002OO  TRACKING  OO\002,/t10,2(\002o\002),12x,2(\002o\002)/t10,16(\002o\002)//131(\002-\002)//)";
    static char fmt_10000[] = "(\002 \002/t10,\002TRACKING ENDED ABNORMALLY\002/t10,\002PARTICLE \002,i3,\002 RANDOM SEED \002,i8,/t10,\002 MOMENTUM DEVIATION \002,g12.5,\002 LOST IN REVOLUTION \002,i8,/t10,\002HORIZ:  AMPLITUDE = \002,f15.3,\002   APERTURE = \002,f15.3/t10,\002VERT:   AMPLITUDE = \002,f15.3,\002   APERTURE = \002,f15.3/)";
    static char fmt_10280[] = "(10x,f47.33)";
    static char fmt_10240[] = "(1x/5x,\002PARTICLE \002,i3,\002 STABLE - RANDOM SEED \002,i8,\002 MOMENTUM DEVIATION \002,g12.5/5x,\002REVOLUTION \002,i8/)";
    static char fmt_10270[] = "(1x/5x,\002PARTICLE \002,i3,\002 AND \002,i3,\002 STABLE - RANDOM SEED \002,i8,\002 MOMENTUM DEVIATION \002,g12.5/5x,\002REVOLUTION \002,i8/)";
    static char fmt_10300[] = "(/10x,\002Sixtrack \002,i12,\002 Turn(s)\002,\002 Completed\002//131(\002-\002))";

     
    integer i__1, i__2, i__3;
    doublereal d__1, d__2, d__3, d__4, d__5;
    olist o__1;
    cllist cl__1;
    alist al__1;

     
    integer s_wsfe(), e_wsfe(), f_open();
      int s_copy();
    double atan(), sqrt();
    integer f_clos(), do_fio(), s_rsle(), do_lio(), e_rsle(), f_rew(), s_wsue(
	    ), do_uio(), e_wsue(), s_rsue(), e_rsue();
    double sin(), cos();
    integer s_wsle(), e_wsle();
      int s_stop();

     
    extern   int sixdaco6_();
    static integer nerror;
    static doublereal taus, phag;
    static integer iratioeicoe;
    static doublereal rat0, dsign, chi, dchi, sic, coc, dpsic, dam1;
    extern   int envarsv_();
    static integer ikk, lkk, mkk;
    static doublereal dpoff;
    static integer napxto, iposc, ndafi2;
    extern   int hplend_(), distance_(), writebin_(), 
	    trauthck_();
    static integer nthinerr;
    extern   int trauthin_();
    static integer i__, j, k, l, m, i1, i2, j2, i3;
    static doublereal r0;
    static integer ia, ll, ix, im, ib, jj;
    static doublereal x11;
    static integer ib0;
    static doublereal r0a, dp0, dq1, dq2;
    static integer iq1, iq2, ib1, ib3, ib2, i6t;
    static doublereal x13;
    static integer ii, ia2, jm, id, ie, ig;
    static char cpto[4], cdate[8], ctime[8];
    static integer rdummy[6];
    static char progrm[8];
    static doublereal cor6d[4]	 ;
    extern   int xuflow_(), comnul_(), daten_(), hlimit_(), 
	    hplint_(), igmeta_(), hplcap_(), hplopt_(), hplset_(), postpr_(), 
	    sumpos_();
    static doublereal amp00;
    static integer iation;
    static doublereal dp00;
    extern   int recuin_(), ranecu_();
    static doublereal rsum, rmean, rsqsum, rdev;
    extern   int ord_(), clorb_(), rmod_(), qmod_(), chroma_(),
	     decoup_(), error_(), linopt_(), subre_(), search_();
    static integer izu, kpz, kzz, nmz;
    static doublereal ddp1, dp10, x1old1, x2old1, y1old1, y2old1, dpold1, 
	    x1old2, x2old2, y1old2;
    static integer irecuin;
    static doublereal y2old2, dpold2;
    static integer noold, nvold, nv2old, itraold, itu6d;
    extern   int corrorb_();
    static integer nsixo, isixda;
    extern   int betalf_(), phasad_();
    static integer intwx1, intwx2;
    extern   int dalie6s_();
    static doublereal dq6t;
    static integer ib11, iar;
    static doublereal bet0x2;
    static integer ncorruo;
    static doublereal bet0x3, gam0x1, gam0x2, gam0x3, alf0x2, alf0x3, bet0z2, 
	    bet0z3, gam0z1, gam0z2, gam0z3, alf0z2, alf0z3, bet0s1, bet0s2, 
	    bet0s3, gam0s1, gam0s2, gam0s3, alf0s1, alf0s2, alf0s3;
    extern   int dinv_();
    static doublereal sigmold1, sigmold2;

     
    static cilist io___2749 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___2754 = { 0, 6, 0, fmt_10030, 0 };
    static cilist io___2755 = { 0, 6, 0, fmt_10040, 0 };
    static cilist io___2756 = { 0, 6, 0, fmt_10025, 0 };
    static cilist io___2768 = { 0, 6, 0, fmt_10320, 0 };
    static cilist io___2769 = { 0, 6, 0, fmt_10070, 0 };
    static cilist io___2776 = { 0, 31, 0, "(a16,1p,d19.11,2d14.6,d17.9)", 0 };
    static cilist io___2786 = { 0, 33, 0, 0, 0 };
    static cilist io___2809 = { 0, 6, 0, fmt_10130, 0 };
    static cilist io___2810 = { 0, 6, 0, fmt_10140, 0 };
    static cilist io___2811 = { 0, 6, 0, fmt_10140, 0 };
    static cilist io___2812 = { 0, 6, 0, fmt_10140, 0 };
    static cilist io___2819 = { 0, 6, 0, fmt_10340, 0 };
    static cilist io___2820 = { 0, 6, 0, fmt_10350, 0 };
    static cilist io___2854 = { 0, 6, 0, fmt_10230, 0 };
    static cilist io___2855 = { 0, 6, 0, fmt_10070, 0 };
    static cilist io___2857 = { 0, 6, 0, fmt_10170, 0 };
    static cilist io___2858 = { 0, 6, 0, fmt_10150, 0 };
    static cilist io___2859 = { 0, 6, 0, fmt_10160, 0 };
    static cilist io___2860 = { 0, 6, 0, fmt_10190, 0 };
    static cilist io___2861 = { 0, 6, 0, fmt_10210, 0 };
    static cilist io___2862 = { 0, 6, 0, fmt_10220, 0 };
    static cilist io___2863 = { 0, 6, 0, fmt_10080, 0 };
    static cilist io___2864 = { 0, 6, 0, fmt_10110, 0 };
    static cilist io___2865 = { 0, 6, 0, fmt_10120, 0 };
    static cilist io___2868 = { 0, 32, 0, 0, 0 };
    static cilist io___2870 = { 0, 32, 0, 0, 0 };
    static cilist io___2871 = { 0, 32, 0, 0, 0 };
    static cilist io___2872 = { 0, 32, 0, 0, 0 };
    static cilist io___2875 = { 0, 6, 0, fmt_10050, 0 };
    static cilist io___2886 = { 0, 6, 0, fmt_10260, 0 };
    static cilist io___2887 = { 0, 6, 0, fmt_10060, 0 };
    static cilist io___2888 = { 0, 6, 0, fmt_10020, 0 };
    static cilist io___2889 = { 1, 13, 1, 0, 0 };
    static cilist io___2890 = { 0, 6, 0, fmt_10090, 0 };
    static cilist io___2893 = { 1, 0, 0, 0, 0 };
    static cilist io___2896 = { 1, 0, 0, 0, 0 };
    static cilist io___2897 = { 0, 6, 0, 0, 0 };
    static cilist io___2898 = { 0, 6, 0, 0, 0 };
    static cilist io___2899 = { 0, 6, 0, 0, 0 };
    static cilist io___2900 = { 0, 6, 0, 0, 0 };
    static cilist io___2906 = { 0, 6, 0, fmt_10200, 0 };
    static cilist io___2911 = { 0, 6, 0, fmt_10000, 0 };
    static cilist io___2912 = { 0, 6, 0, fmt_10000, 0 };
    static cilist io___2913 = { 0, 6, 0, fmt_10280, 0 };
    static cilist io___2914 = { 1, 12, 0, fmt_10280, 0 };
    static cilist io___2915 = { 0, 6, 0, 0, 0 };
    static cilist io___2916 = { 0, 6, 0, fmt_10240, 0 };
    static cilist io___2917 = { 0, 6, 0, fmt_10000, 0 };
    static cilist io___2918 = { 0, 6, 0, fmt_10280, 0 };
    static cilist io___2919 = { 1, 12, 0, fmt_10280, 0 };
    static cilist io___2920 = { 0, 6, 0, 0, 0 };
    static cilist io___2921 = { 0, 6, 0, fmt_10000, 0 };
    static cilist io___2922 = { 0, 6, 0, fmt_10240, 0 };
    static cilist io___2923 = { 0, 6, 0, fmt_10280, 0 };
    static cilist io___2924 = { 1, 12, 0, fmt_10280, 0 };
    static cilist io___2925 = { 0, 6, 0, 0, 0 };
    static cilist io___2927 = { 0, 6, 0, fmt_10270, 0 };
    static cilist io___2928 = { 0, 6, 0, fmt_10280, 0 };
    static cilist io___2929 = { 1, 12, 0, fmt_10280, 0 };
    static cilist io___2930 = { 0, 6, 0, 0, 0 };
    static cilist io___2933 = { 0, 6, 0, fmt_10300, 0 };


 
 


 

 

 

 

 
 

 

 
 
 
 
 
 
 
 
 
 

 

    s_wsfe(&io___2749);
    e_wsfe();
    o__1.oerr = 0;
    o__1.ounit = 2;
    o__1.ofnmlen = 6;
    o__1.ofnm = "fort.2";
    o__1.orl = 0;
    o__1.osta = 0;
    o__1.oacc = 0;
    o__1.ofm = 0;
    o__1.oblnk = 0;
    f_open(&o__1);
    o__1.oerr = 0;
    o__1.ounit = 3;
    o__1.ofnmlen = 6;
    o__1.ofnm = "fort.3";
    o__1.orl = 0;
    o__1.osta = 0;
    o__1.oacc = 0;
    o__1.ofm = 0;
    o__1.oblnk = 0;
    f_open(&o__1);
    o__1.oerr = 0;
    o__1.ounit = 7;
    o__1.ofnmlen = 6;
    o__1.ofnm = "fort.7";
    o__1.orl = 0;
    o__1.osta = 0;
    o__1.oacc = 0;
    o__1.ofm = 0;
    o__1.oblnk = 0;
    f_open(&o__1);
    o__1.oerr = 0;
    o__1.ounit = 8;
    o__1.ofnmlen = 6;
    o__1.ofnm = "fort.8";
    o__1.orl = 0;
    o__1.osta = 0;
    o__1.oacc = 0;
    o__1.ofm = 0;
    o__1.oblnk = 0;
    f_open(&o__1);
    o__1.oerr = 0;
    o__1.ounit = 16;
    o__1.ofnmlen = 7;
    o__1.ofnm = "fort.16";
    o__1.orl = 0;
    o__1.osta = 0;
    o__1.oacc = 0;
    o__1.ofm = 0;
    o__1.oblnk = 0;
    f_open(&o__1);
    xuflow_(&c__0);
    for (i__ = 1; i__ <= 20000; ++i__) {
	xz_ .xsi[i__ - 1] = 0.;
	xz_ .zsi[i__ - 1] = 0.;
	xz_ .smi[i__ - 1] = 0.;
	rfres_ .rsmi[i__ - 1] = 0.;
	rfres_ .rfres[i__ - 1] = 0.;
	rfres_ .rzphs[i__ - 1] = 0.;
 
    }
    for (i__ = 1; i__ <= 11; ++i__) {
	main1_ .cr[i__ - 1] = 0.;
	main1_ .ci[i__ - 1] = 0.;
 
    }
    for (i__ = 1; i__ <= 2; ++i__) {
	main1_ .eps[i__ - 1] = 0.;
	main1_ .epsa[i__ - 1] = 0.;
	main1_ .ekk[i__ - 1] = 0.;
	main1_ .qw[i__ - 1] = 0.;
	main1_ .qwc[i__ - 1] = 0.;
 
    }
    for (i__ = 1; i__ <= 64; ++i__) {
	postr2_ .nnumxv[i__ - 1] = 0;
	main1_ .xv[(i__ << 1) - 2] = 0.;
	main1_ .xv[(i__ << 1) - 1] = 0.;
	main1_ .yv[(i__ << 1) - 2] = 0.;
	main1_ .yv[(i__ << 1) - 1] = 0.;
	main1_ .dam[i__ - 1] = 0.;
	main1_ .ekkv[i__ - 1] = 0.;
	main1_ .sigmv[i__ - 1] = 0.;
	main1_ .dpsv[i__ - 1] = 0.;
	main1_ .dp0v[i__ - 1] = 0.;
	main1_ .ejv[i__ - 1] = 0.;
	main1_ .ejfv[i__ - 1] = 0.;
	main1_ .xlv[i__ - 1] = 0.;
	main1_ .zlv[i__ - 1] = 0.;
	main1_ .rvv[i__ - 1] = 1.;
	main1_ .ejf0v[i__ - 1] = 0.;
	main2_ .dpd[i__ - 1] = 0.;
	main2_ .dpsq[i__ - 1] = 0.;
	main2_ .fok[i__ - 1] = 0.;
	main2_ .rho[i__ - 1] = 0.;
	main2_ .fok1[i__ - 1] = 0.;
	main2_ .si[i__ - 1] = 0.;
	main2_ .co[i__ - 1] = 0.;
	main2_ .g[i__ - 1] = 0.;
	main2_ .gl[i__ - 1] = 0.;
	main2_ .sm1[i__ - 1] = 0.;
	main2_ .sm2[i__ - 1] = 0.;
	main2_ .sm3[i__ - 1] = 0.;
	main2_ .sm12[i__ - 1] = 0.;
	main2_ .as3[i__ - 1] = 0.;
	main2_ .as4[i__ - 1] = 0.;
	main2_ .as6[i__ - 1] = 0.;
	main2_ .sm23[i__ - 1] = 0.;
	main2_ .rhoc[i__ - 1] = 0.;
	main2_ .siq[i__ - 1] = 0.;
	main2_ .aek[i__ - 1] = 0.;
	main2_ .afok[i__ - 1] = 0.;
	main2_ .hp[i__ - 1] = 0.;
	main2_ .hm[i__ - 1] = 0.;
	main2_ .hc[i__ - 1] = 0.;
	main2_ .hs[i__ - 1] = 0.;
	main2_ .wf[i__ - 1] = 0.;
	main2_ .wfa[i__ - 1] = 0.;
	main2_ .wfhi[i__ - 1] = 0.;
	main2_ .rhoi[i__ - 1] = 0.;
	main2_ .hi[i__ - 1] = 0.;
	main2_ .fi[i__ - 1] = 0.;
	main2_ .hi1[i__ - 1] = 0.;
	main2_ .xvl[(i__ << 1) - 2] = 0.;
	main2_ .xvl[(i__ << 1) - 1] = 0.;
	main2_ .yvl[(i__ << 1) - 2] = 0.;
	main2_ .yvl[(i__ << 1) - 1] = 0.;
	main2_ .ejvl[i__ - 1] = 0.;
	main2_ .dpsvl[i__ - 1] = 0.;
	main2_ .oidpsv[i__ - 1] = 1.;
	main2_ .sigmvl[i__ - 1] = 0.;
	main2_ .iv[i__ - 1] = 0;
	main2_ .aperv[i__ - 1] = 0.;
	main2_ .aperv[i__ + 63] = 0.;
	main2_ .ixv[i__ - 1] = 0;
	main2_ .clov[(i__ << 1) - 2] = 0.;
	main2_ .clov[(i__ << 1) - 1] = 0.;
	main3_ .clo6v[i__ * 3 - 3] = 0.;
	main3_ .clo6v[i__ * 3 - 2] = 0.;
	main3_ .clo6v[i__ * 3 - 1] = 0.;
	main2_ .clopv[(i__ << 1) - 2] = 0.;
	main2_ .clopv[(i__ << 1) - 1] = 0.;
	main3_ .clop6v[i__ * 3 - 3] = 0.;
	main3_ .clop6v[i__ * 3 - 2] = 0.;
	main3_ .clop6v[i__ * 3 - 1] = 0.;
	main2_ .alf0v[i__ - 1] = 0.;
	main2_ .alf0v[i__ + 63] = 0.;
	main2_ .bet0v[i__ - 1] = 0.;
	main2_ .bet0v[i__ + 63] = 0.;
	main2_ .ampv[i__ - 1] = 0.;
	for (i1 = 1; i1 <= 6; ++i1) {
	    for (i2 = 1; i2 <= 6; ++i2) {
		main3_ .tas[i__ + (i1 + i2 * 6 << 6) - 449] = 0.;
 
	    }
	}
	main3_ .qwcs[i__ - 1] = 0.;
	main3_ .qwcs[i__ + 63] = 0.;
	main3_ .qwcs[i__ + 127] = 0.;
	main3_ .di0xs[i__ - 1] = 0.;
	main3_ .di0zs[i__ - 1] = 0.;
	main3_ .dip0xs[i__ - 1] = 0.;
	main3_ .dip0zs[i__ - 1] = 0.;
 
    }
    main1_ .qwc[2] = 0.;
    comnul_();
    s_copy(titc_ .commen, " ", 80L, 1L);
    s_copy(progrm, "SIXTRACK", 8L, 8L);
    kons_ .pi = atan(1.) * 4.;
    kons_ .pi2 = kons_ .pi * .5;
    kons_ .pisqrt = sqrt(kons_ .pi);
    kons_ .rad = kons_ .pi / 180;
    daten_();
    if (tit_ .ithick == 1) {
	s_wsfe(&io___2754);
	e_wsfe();
    }
    if (tit_ .ithick == 0) {
	s_wsfe(&io___2755);
	e_wsfe();
    }
    if (tra1_ .ibidu == 2) {
	s_wsfe(&io___2756);
	e_wsfe();
	goto L550;
    }
 
    if (posti1_ .ipos == 1 && (posti2_ .idis != 0 || posti2_ .icow != 0 || 
	    posti2_ .istw != 0 || posti2_ .iffw != 0)) {
	hlimit_(&c__20000);
	hplint_(& posti2_ .kwtype);
	if (posti2_ .itf == 3) {
	    igmeta_(&c_n20, &c_n111);
	} else {
	    hplcap_(& posti2_ .itf);
	}
	s_copy(cpto, "NPTO", 4L, 4L);
	if (posti2_ .icr == 1) {
	    s_copy(cpto, "PTO ", 4L, 4L);
	}
	hplopt_(cpto, &c__1, 4L);
	hplopt_("DATE", &c__1, 4L);
	hplset_("DATE", &c_b2366, 4L);
	hplset_("CSIZ", &c_b5817, 4L);
    }
    if (posti1_ .ipos == 1 && tra1_ .napx == 0) {
	i__1 = posti2_ .ndafi;
	for (i__ = 1; i__ <= i__1; ++i__) {
	    i__2 = 91 - i__;
	    postpr_(&i__2);
 
	}
	sumpos_();
	goto L520;
    }
    cl__1.cerr = 0;
    cl__1.cunit = 2;
    cl__1.csta = 0;
    f_clos(&cl__1);
    cl__1.cerr = 0;
    cl__1.cunit = 3;
    cl__1.csta = 0;
    f_clos(&cl__1);
    for (i__ = 1; i__ <= 64; ++i__) {
	main1_ .pstop[i__ - 1] = (0) ;
	postr2_ .nnumxv[i__ - 1] = tra1_ .numl;
 
	main1_ .numxv[i__ - 1] = tra1_ .numl;
    }
    for (i__ = 1; i__ <= 20; ++i__) {
	main3_ .fake[(i__ << 1) - 2] = 0.;
 
	main3_ .fake[(i__ << 1) - 1] = 0.;
    }
    anf_ .itra = 2;
    amp00 = (tra_._1) .amp[0];
    if (tra1_ .napx != 1) {
	damp_ .damp = (amp00 - qmodi_ .amp0) / (tra1_ .napx - 1) / 2;
    }
    tra1_ .napx <<= 1;
    iation = (( syn_ .ition ) >= 0 ? ( syn_ .ition ) : -( syn_ .ition )) ;
    ib0 = 0;
    dp00 = anf_ .dp1;
    if (tra1_ .napx <= 0 || tra1_ .imc <= 0) {
	goto L490;
    }
    i__1 = rand0_ .mmac;
    for (m = 1; m <= i__1; ++m) {
 
	if (m >= 2) {
	    i__2 = m * rand0_ .izu0;
	    recuin_(&i__2, &irecuin);
	    ranecu_(rand0_ .zfz, &c_b1102, & rand0_ .mcut);
	    rsum = 0.;
	    for (i__ = 1; i__ <= 300000; ++i__) {
 
		rsum += rand0_ .zfz[i__ - 1];
	    }
	    rmean = rsum / 300000;
	    rsqsum = 0.;
	    for (i__ = 1; i__ <= 300000; ++i__) {
 
		rsqsum += (rand0_ .zfz[i__ - 1] - rmean) * (rand0_ .zfz[i__ - 
			1] - rmean);
	    }
	    rdev = sqrt(rsqsum / 300000);
	    s_wsfe(&io___2768);
	    i__2 = m * rand0_ .izu0;
	    do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&c_b1102, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&rmean, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&rdev, (ftnlen)sizeof(doublereal));
	    e_wsfe();
	    s_wsfe(&io___2769);
	    e_wsfe();
	}
	if (m == 1) {
	    ord_();
	}
	clorb_(& clo_ .ded);
	for (l = 1; l <= 2; ++l) {
	    main1_ .clo0[l - 1] = (tra_._1) .clo[l - 1];
 
	    main1_ .clop0[l - 1] = (tra_._1) .clop[l - 1];
	}
	clorb_(&c_b251);
	for (l = 1; l <= 2; ++l) {
	    ll = l << 1;
	    beo_ .di0[l - 1] = (main1_ .clo0[l - 1] - (tra_._1) .clo[l - 1]) / 
		    clo_ .ded;
 
	    beo_ .dip0[l - 1] = (main1_ .clop0[l - 1] - (tra_._1) .clop[l - 1]) / 
		    clo_ .ded;
	}
	corrorb_();
	if (secom_ .irmod2 == 1) {
	    rmod_(& anf_ .dp1);
	}
	if (qmodi_ .iqmod != 0) {
	    qmod_();
	}
	if ((chrom_._1) .ichrom != 0) {
	    chroma_();
	}
	if (skew_ .iskew != 0) {
	    decoup_();
	}
 
	if (beam_ .nbeam >= 1) {
	    for (i__ = 1; i__ <= 700; ++i__) {
		if (ell_ .kz[i__ - 1] == 20) {
		    ++ linop_ .nlin;
		    if (linop_ .nlin > 700) {
			error_(&c__81);
		    }
		    s_copy(linopc_ .bezl + (linop_ .nlin - 1 << 4), 
			    linopc_ .bez + (i__ - 1 << 4), 16L, 16L);
		}
 
	    }
	}
	if (linop_ .ilin != 0) {
	    linopt_(& anf_ .dp1);
	}
	if (subres_ .isub == 1) {
	    subre_(& anf_ .dp1);
	}
	if (sea_ .ise == 1) {
	    search_(& anf_ .dp1);
	}
	izu = 0;
	i__2 = str_ .iu;
	for (i__ = 1; i__ <= i__2; ++i__) {
	    ix = str_ .ic[i__ - 1];
	    if (ix <= 300) {
		goto L150;
	    }
	    ix += -300;
	    kpz = ell_ .kp[ix - 1];
	    kzz = ell_ .kz[ix - 1];
	    if (kpz == 6 || kzz == 0) {
		goto L150;
	    }
	    if (rand0_ .iorg < 0) {
		rand0_ .mzu[i__ - 1] = izu;
	    }
	    izu = rand0_ .mzu[i__ - 1] + 1;
	    main1_ .smiv[m + i__ - 2] = ell_ .sm[ix - 1] + rand0_ .zfz[izu - 
		    1] * ell_ .ek[ix - 1];
	    xz_ .smi[i__ - 1] = main1_ .smiv[m + i__ - 2];
	    ++izu;
	    main1_ .xsiv[m + i__ - 2] = pla_ .xpl[ix - 1] + rand0_ .zfz[izu - 
		    1] * pla_ .xrms[ix - 1];
	    xz_ .xsi[i__ - 1] = main1_ .xsiv[m + i__ - 2];
	    ++izu;
	    main1_ .zsiv[m + i__ - 2] = pla_ .zpl[ix - 1] + rand0_ .zfz[izu - 
		    1] * pla_ .zrms[ix - 1];
	    xz_ .zsi[i__ - 1] = main1_ .zsiv[m + i__ - 2];
	    if (rand1_ .mout2 == 1) {
		if (kzz == 11) {
		    rand0_ .zfz[izu - 3] = 0.;
		}
		if ((d__1 = ell_ .ek[ix - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
		    rand0_ .zfz[izu - 3] = 0.;
		}
		if ((d__1 = pla_ .xrms[ix - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
		    rand0_ .zfz[izu - 2] = 0.;
		}
		if ((d__1 = pla_ .zrms[ix - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
		    rand0_ .zfz[izu - 1] = 0.;
		}
		s_wsfe(&io___2776);
		do_fio(&c__1, linopc_ .bez + (ix - 1 << 4), 16L);
		do_fio(&c__1, (char *)& rand0_ .zfz[izu - 3], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)& rand0_ .zfz[izu - 2], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)& rand0_ .zfz[izu - 1], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)& rand1_ .extalign[i__ + 39999], (ftnlen)
			sizeof(doublereal));
		e_wsfe();
	    }
	    if (kzz == 11) {
		r0 = ell_ .ek[ix - 1];
		if ((( r0 ) >= 0 ? ( r0 ) : -( r0 ))  <= 1e-17) {
		    goto L150;
		}
		nmz = mult1_ .nmu[ix - 1];
		if (nmz == 0) {
		    izu += 22;
		    goto L150;
		}
		im = mult1_ .irm[ix - 1];
		r0a = 1.;
		i__3 = nmz;
		for (k = 1; k <= i__3; ++k) {
		    ++izu;
		    main1_ .aaiv[k + (m + i__) * 11 - 23] = ell_ .ed[ix - 1] *
			     (multi_ .ak0[im + k * 700 - 701] + rand0_ .zfz[
			    izu - 1] * multi_ .aka[im + k * 700 - 701]) / r0a;
		    xz_ .aai[i__ + k * 20000 - 20001] = main1_ .aaiv[k + (m + 
			    i__) * 11 - 23];
		    ++izu;
		    main1_ .bbiv[k + (m + i__) * 11 - 23] = ell_ .ed[ix - 1] *
			     (multi_ .bk0[im + k * 700 - 701] + rand0_ .zfz[
			    izu - 1] * multi_ .bka[im + k * 700 - 701]) / r0a;
		    xz_ .bbi[i__ + k * 20000 - 20001] = main1_ .bbiv[k + (m + 
			    i__) * 11 - 23];
 
		    r0a *= r0;
		}
		izu = izu + 22 - (nmz << 1);
	    }
L150:
	    ;
	}
	dp0 = dp00;
	if (tra1_ .imc > 1) {
	    ddp1 = dp0 * 2. / (tra1_ .imc - 1.);
	}
	i__2 = tra1_ .imc;
	for (ib = 1; ib <= i__2; ++ib) {
	    if (tra1_ .imc > 1) {
		anf_ .dp1 = dp0 - (ib - 1) * ddp1;
	    }
	    dp10 = anf_ .dp1;
 

	    if (syn_ .idp != 1 || iation != 1) {
		tra1_ .iclo6 = 0;
	    }
	    if (tra1_ .iclo6 == 1 || tra1_ .iclo6 == 2) {
		if (ib == 1) {
		    if (tra1_ .iclo6r == 0) {
			co6d_ .clo6[0] = 0.;
			co6d_ .clo6[1] = 0.;
			co6d_ .clo6[2] = 0.;
			co6d_ .clop6[0] = 0.;
			co6d_ .clop6[1] = 0.;
			co6d_ .clop6[2] = 0.;
		    } else {
			s_rsle(&io___2786);
			for (l = 1; l <= 3; ++l) {
			    do_lio(&c__5, &c__1, (char *)& co6d_ .clo6[l - 1], 
				    (ftnlen)sizeof(doublereal));
			    do_lio(&c__5, &c__1, (char *)& co6d_ .clop6[l - 1],
				     (ftnlen)sizeof(doublereal));
			}
			e_rsle();
		    }
		    x1old1 = (tra_._1) .x[0];
		    x2old1 = (tra_._1) .x[6];
		    y1old1 = (tra_._1) .y[0];
		    y2old1 = (tra_._1) .y[6];
		    sigmold1 = syos_ .sigm[0];
		    dpold1 = syos_ .dps[0];
		    x1old2 = (tra_._1) .x[1];
		    x2old2 = (tra_._1) .x[7];
		    y1old2 = (tra_._1) .y[1];
		    y2old2 = (tra_._1) .y[7];
		    sigmold2 = syos_ .sigm[1];
		    dpold2 = syos_ .dps[1];
		    noold = dial_ .nord;
		    nvold = dial_ .nvar;
		    nv2old = dial_ .nvar2;
		    itraold = anf_ .itra;
		    itu6d = 0;
		    iq1 = qmodi_ .iq[0];
		    iq2 = qmodi_ .iq[1];
		    if (qmodi_ .iqmod6 == 1) {
			sixdim_ .edcor[0] = ell_ .ed[iq1 - 1];
			sixdim_ .edcor[1] = ell_ .ed[iq2 - 1];
		    }
		    ncorruo = clos_ .ncorru;
		    clos_ .ncorru = 1;
		    nsixo = dial_ .nsix;
L175:
		    dial_ .nord = 1;
		    dial_ .nvar = 6;
		    dial_ .nvar2 = 6;
		    dial_ .nsix = 0;
		    if (beam_ .nbeam >= 1) {
			beam_ .nvbeam = -1;
			linopt_(& co6d_ .clop6[2]);
		    }
		    isixda = 1;
		    sixdaco6_(&isixda);
		    if (qmodi_ .iqmod6 == 1) {
			for (l = 1; l <= 2; ++l) {
			    (tra_._1) .x[l * 6 - 6] = co6d_ .clo6[l - 1];
			    (tra_._1) .y[l * 6 - 6] = co6d_ .clop6[l - 1];
 
			}
			syos_ .sigm[0] = co6d_ .clo6[2];
			syos_ .dps[0] = co6d_ .clop6[2];
			dial_ .nord = 2;
			dial_ .nvar = 8;
			sixdim_ .mapout = 1;
			dial_ .idalloc = 3;
			isixda = 2;
			sixdaco6_(&isixda);
		    }
		    s_wsfe(&io___2809);
		    do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
		    e_wsfe();
		    s_wsfe(&io___2810);
		    do_fio(&c__1, (char *)& co6d_ .clo6[0], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& co6d_ .clop6[0], (ftnlen)sizeof(
			    doublereal));
		    e_wsfe();
		    s_wsfe(&io___2811);
		    do_fio(&c__1, (char *)& co6d_ .clo6[1], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& co6d_ .clop6[1], (ftnlen)sizeof(
			    doublereal));
		    e_wsfe();
		    s_wsfe(&io___2812);
		    do_fio(&c__1, (char *)& co6d_ .clo6[2], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& co6d_ .clop6[2], (ftnlen)sizeof(
			    doublereal));
		    e_wsfe();
		    (tra_._1) .x[0] = x1old1;
		    (tra_._1) .x[6] = x2old1;
		    (tra_._1) .y[0] = y1old1;
		    (tra_._1) .y[6] = y2old1;
		    syos_ .sigm[0] = sigmold1;
		    syos_ .dps[0] = dpold1;
		    (tra_._1) .x[1] = x1old2;
		    (tra_._1) .x[7] = x2old2;
		    (tra_._1) .y[1] = y1old2;
		    (tra_._1) .y[7] = y2old2;
		    syos_ .sigm[1] = sigmold2;
		    syos_ .dps[1] = dpold2;
		    anf_ .dp1 = dp10 + co6d_ .clop6[2];
		    clorb_(& co6d_ .clop6[2]);
		    betalf_(& co6d_ .clop6[2], main1_ .qw);
		    phasad_(& co6d_ .clop6[2], main1_ .qwc);
		    intwx1 = (integer) main1_ .qwc[0];
		    main3_ .wx[0] = main1_ .qwc[0] - intwx1;
		    intwx2 = (integer) main1_ .qwc[1];
		    main3_ .wx[1] = main1_ .qwc[1] - intwx2;
		    main3_ .wx[2] = 0.;
		    if (qmodi_ .iqmod6 != 1) {
			dalie6s_(& qmodi_ .iqmod6, &c__1, main3_ .wx, cor6d);
		    } else {
			dalie6s_(& qmodi_ .iqmod6, &c__3, main3_ .wx, cor6d);
		    }
		    al__1.aerr = 0;
		    al__1.aunit = 18;
		    f_rew(&al__1);
		    main1_ .qwc[0] = intwx1 + main3_ .wx[0];
		    main1_ .qwc[1] = intwx2 + main3_ .wx[1];
		    main1_ .qwc[2] = main3_ .wx[2];
		    if (qmodi_ .iqmod6 == 1) {
			++itu6d;
			if (itu6d > 1) {
			    dq6t = sqrt(dq1 * dq1 + dq2 * dq2);
			    s_wsfe(&io___2819);
			    do_fio(&c__1, (char *)& qmodi_ .qw0[0], (ftnlen)
				    sizeof(doublereal));
			    do_fio(&c__1, (char *)& main1_ .qwc[0], (ftnlen)
				    sizeof(doublereal));
			    do_fio(&c__1, (char *)& qmodi_ .qw0[1], (ftnlen)
				    sizeof(doublereal));
			    do_fio(&c__1, (char *)& main1_ .qwc[1], (ftnlen)
				    sizeof(doublereal));
			    i__3 = itu6d - 1;
			    do_fio(&c__1, (char *)&i__3, (ftnlen)sizeof(
				    integer));
			    do_fio(&c__1, (char *)&dq6t, (ftnlen)sizeof(
				    doublereal));
			    e_wsfe();
			    s_wsfe(&io___2820);
			    do_fio(&c__1, (char *)& sixdim_ .edcor[0], (ftnlen)
				    sizeof(doublereal));
			    do_fio(&c__1, (char *)& ell_ .ed[iq1 - 1], (ftnlen)
				    sizeof(doublereal));
			    do_fio(&c__1, linopc_ .bez + (iq1 - 1 << 4), 16L);
			    do_fio(&c__1, (char *)& sixdim_ .edcor[1], (ftnlen)
				    sizeof(doublereal));
			    do_fio(&c__1, (char *)& ell_ .ed[iq2 - 1], (ftnlen)
				    sizeof(doublereal));
			    do_fio(&c__1, linopc_ .bez + (iq2 - 1 << 4), 16L);
			    e_wsfe();
			}
			dq1 = main1_ .qwc[0] - qmodi_ .qw0[0];
			dq2 = main1_ .qwc[1] - qmodi_ .qw0[1];
			if (itu6d <= clo_ .itqv && ((( dq1 ) >= 0 ? ( dq1 ) : -( dq1 ))  > clo_ .dqq || 
				(( dq2 ) >= 0 ? ( dq2 ) : -( dq2 ))  > clo_ .dqq)) {
			    if (ell_ .el[iq1 - 1] <= 1e-17) {
				ell_ .ed[iq1 - 1] = ell_ .ed[iq1 - 1] - cor6d[
					0] * dq1 - cor6d[2] * dq2;
			    } else {
				ell_ .ek[iq1 - 1] = ell_ .ek[iq1 - 1] - cor6d[
					0] * dq1 - cor6d[2] * dq2;
			    }
			    if (ell_ .el[iq2 - 1] <= 1e-17) {
				ell_ .ed[iq2 - 1] = ell_ .ed[iq2 - 1] - cor6d[
					1] * dq1 - cor6d[3] * dq2;
			    } else {
				ell_ .ek[iq2 - 1] = ell_ .ek[iq2 - 1] - cor6d[
					1] * dq1 - cor6d[3] * dq2;
			    }
			    goto L175;
			} else {
			    i__3 = str_ .iu;
			    for (i6t = 1; i6t <= i__3; ++i6t) {
				ix = str_ .ic[i6t - 1] - 300;
				if (ix == iq1 || combin_ .iratioe[ix - 1] == 
					iq1) {
				    xz_ .smi[i6t - 1] += (ell_ .ed[iq1 - 1] - 
					    sixdim_ .edcor[0]) * 
					    combin_ .ratioe[ix - 1];
				    main1_ .smiv[m + i6t - 2] = xz_ .smi[i6t 
					    - 1];
				} else if (ix == iq2 || combin_ .iratioe[ix - 
					1] == iq2) {
				    xz_ .smi[i6t - 1] += (ell_ .ed[iq2 - 1] - 
					    sixdim_ .edcor[1]) * 
					    combin_ .ratioe[ix - 1];
				    main1_ .smiv[m + i6t - 2] = xz_ .smi[i6t 
					    - 1];
				}
 
			    }
			}
		    }
		    dial_ .nsix = nsixo;
		    dial_ .nord = noold;
		    dial_ .nvar = nvold;
		    dial_ .nvar2 = nv2old;
		    anf_ .itra = itraold;
		}
		dial_ .idalloc = 1;
		clos_ .ncorru = ncorruo;
		i__3 = tra1_ .napx;
		for (ib1 = 1; ib1 <= i__3; ++ib1) {
		    ib3 = ib1 + (m + ib - 2) * tra1_ .napx;
 
		    if (beam_ .nbeam >= 1) {
			for (ib11 = 1; ib11 <= 700; ++ib11) {
			    if (ell_ .kz[ib11 - 1] == 20) {
				beam_ .clobeam[(ib3 + (ib11 << 6) << 1) - 130]
					 = beam_ .clobaux[(ib11 << 1) - 2];
				beam_ .clobeam[(ib3 + (ib11 << 6) << 1) - 129]
					 = beam_ .clobaux[(ib11 << 1) - 1];
			    }
 
			}
		    }
		    main3_ .clo6v[ib3 * 3 - 3] = co6d_ .clo6[0];
		    main3_ .clo6v[ib3 * 3 - 2] = co6d_ .clo6[1];
		    main3_ .clo6v[ib3 * 3 - 1] = co6d_ .clo6[2];
		    main3_ .clop6v[ib3 * 3 - 3] = co6d_ .clop6[0];
		    main3_ .clop6v[ib3 * 3 - 2] = co6d_ .clop6[1];
		    main3_ .clop6v[ib3 * 3 - 1] = co6d_ .clop6[2];
		    main3_ .di0xs[ib3 - 1] = beo_ .di0[0];
		    main3_ .di0zs[ib3 - 1] = beo_ .di0[1];
		    main3_ .dip0xs[ib3 - 1] = beo_ .dip0[0];
		    main3_ .dip0zs[ib3 - 1] = beo_ .dip0[1];
		    main3_ .qwcs[ib3 - 1] = main1_ .qwc[0];
		    main3_ .qwcs[ib3 + 63] = main1_ .qwc[1];
		    main3_ .qwcs[ib3 + 127] = main1_ .qwc[2];
		    for (i2 = 1; i2 <= 6; ++i2) {
			for (j2 = 1; j2 <= 6; ++j2) {
			    main3_ .tas[ib3 + (i2 + j2 * 6 << 6) - 449] = 
				    tasm_ .tasm[i2 + j2 * 6 - 7];
 
			}
		    }
 
		}
	    } else {
		if (syn_ .idp == 1 && iation == 1) {
		    clorb_(&c_b251);
		    betalf_(&c_b251, main1_ .qw);
		    phasad_(&c_b251, main1_ .qwc);
		} else {
		    clorb_(& anf_ .dp1);
		    betalf_(& anf_ .dp1, main1_ .qw);
		    phasad_(& anf_ .dp1, main1_ .qwc);
		}
		i__3 = tra1_ .napx;
		for (i__ = 1; i__ <= i__3; ++i__) {
		    iar = (m + ib - 2) * tra1_ .napx + i__;
		    main3_ .clo6v[iar * 3 - 3] = (tra_._1) .clo[0];
		    main3_ .clop6v[iar * 3 - 3] = (tra_._1) .clop[0];
		    main3_ .clo6v[iar * 3 - 2] = (tra_._1) .clo[1];
		    main3_ .clop6v[iar * 3 - 2] = (tra_._1) .clop[1];
		    main3_ .di0xs[iar - 1] = beo_ .di0[0];
		    main3_ .di0zs[iar - 1] = beo_ .di0[1];
		    main3_ .dip0xs[iar - 1] = beo_ .dip0[0];
		    main3_ .dip0zs[iar - 1] = beo_ .dip0[1];
		    main3_ .qwcs[iar - 1] = main1_ .qwc[0];
		    main3_ .qwcs[iar + 63] = main1_ .qwc[1];
		    main3_ .qwcs[iar + 127] = 0.;
		    for (i2 = 1; i2 <= 4; ++i2) {
			for (j2 = 1; j2 <= 4; ++j2) {
 
			    main3_ .tas[iar + (i2 + j2 * 6 << 6) - 449] = 
				    beo_ .ta[i2 + j2 * 6 - 7];
			}
		    }
 
		}
	    }
	    iar = (m + ib - 2) * tra1_ .napx + 1;
	    (tra_._1) .bet0[0] = main3_ .tas[iar - 1] * main3_ .tas[iar - 1] + 
		    main3_ .tas[iar + 383] * main3_ .tas[iar + 383];
	    bet0x2 = main3_ .tas[iar + 767] * main3_ .tas[iar + 767] + 
		    main3_ .tas[iar + 1151] * main3_ .tas[iar + 1151];
	    bet0x3 = main3_ .tas[iar + 1535] * main3_ .tas[iar + 1535] + 
		    main3_ .tas[iar + 1919] * main3_ .tas[iar + 1919];
	    gam0x1 = main3_ .tas[iar + 63] * main3_ .tas[iar + 63] + 
		    main3_ .tas[iar + 447] * main3_ .tas[iar + 447];
	    gam0x2 = main3_ .tas[iar + 831] * main3_ .tas[iar + 831] + 
		    main3_ .tas[iar + 1215] * main3_ .tas[iar + 1215];
	    gam0x3 = main3_ .tas[iar + 1599] * main3_ .tas[iar + 1599] + 
		    main3_ .tas[iar + 1983] * main3_ .tas[iar + 1983];
	    (tra_._1) .alf0[0] = -(main3_ .tas[iar - 1] * main3_ .tas[iar + 63] + 
		    main3_ .tas[iar + 383] * main3_ .tas[iar + 447]);
	    alf0x2 = -(main3_ .tas[iar + 767] * main3_ .tas[iar + 831] + 
		    main3_ .tas[iar + 1151] * main3_ .tas[iar + 1215]);
	    alf0x3 = -(main3_ .tas[iar + 1535] * main3_ .tas[iar + 1599] + 
		    main3_ .tas[iar + 1919] * main3_ .tas[iar + 1983]);
	    (tra_._1) .bet0[1] = main3_ .tas[iar + 895] * main3_ .tas[iar + 895] + 
		    main3_ .tas[iar + 1279] * main3_ .tas[iar + 1279];
	    bet0z2 = main3_ .tas[iar + 127] * main3_ .tas[iar + 127] + 
		    main3_ .tas[iar + 511] * main3_ .tas[iar + 511];
	    bet0z3 = main3_ .tas[iar + 1663] * main3_ .tas[iar + 1663] + 
		    main3_ .tas[iar + 2047] * main3_ .tas[iar + 2047];
	    gam0z1 = main3_ .tas[iar + 959] * main3_ .tas[iar + 959] + 
		    main3_ .tas[iar + 1343] * main3_ .tas[iar + 1343];
	    gam0z2 = main3_ .tas[iar + 191] * main3_ .tas[iar + 191] + 
		    main3_ .tas[iar + 575] * main3_ .tas[iar + 575];
	    gam0z3 = main3_ .tas[iar + 1727] * main3_ .tas[iar + 1727] + 
		    main3_ .tas[iar + 2111] * main3_ .tas[iar + 2111];
	    (tra_._1) .alf0[1] = -(main3_ .tas[iar + 895] * main3_ .tas[iar + 959] 
		    + main3_ .tas[iar + 1279] * main3_ .tas[iar + 1343]);
	    alf0z2 = -(main3_ .tas[iar + 127] * main3_ .tas[iar + 191] + 
		    main3_ .tas[iar + 511] * main3_ .tas[iar + 575]);
	    alf0z3 = -(main3_ .tas[iar + 1663] * main3_ .tas[iar + 1727] + 
		    main3_ .tas[iar + 2047] * main3_ .tas[iar + 2111]);
	    bet0s1 = main3_ .tas[iar + 1791] * main3_ .tas[iar + 1791] + 
		    main3_ .tas[iar + 2175] * main3_ .tas[iar + 2175];
	    bet0s2 = main3_ .tas[iar + 255] * main3_ .tas[iar + 255] + 
		    main3_ .tas[iar + 639] * main3_ .tas[iar + 639];
	    bet0s3 = main3_ .tas[iar + 1023] * main3_ .tas[iar + 1023] + 
		    main3_ .tas[iar + 1407] * main3_ .tas[iar + 1407];
	    gam0s1 = main3_ .tas[iar + 1855] * main3_ .tas[iar + 1855] + 
		    main3_ .tas[iar + 2239] * main3_ .tas[iar + 2239];
	    gam0s2 = main3_ .tas[iar + 319] * main3_ .tas[iar + 319] + 
		    main3_ .tas[iar + 703] * main3_ .tas[iar + 703];
	    gam0s3 = main3_ .tas[iar + 1087] * main3_ .tas[iar + 1087] + 
		    main3_ .tas[iar + 1471] * main3_ .tas[iar + 1471];
	    alf0s1 = -(main3_ .tas[iar + 1791] * main3_ .tas[iar + 1855] + 
		    main3_ .tas[iar + 2175] * main3_ .tas[iar + 2239]);
	    alf0s2 = -(main3_ .tas[iar + 255] * main3_ .tas[iar + 319] + 
		    main3_ .tas[iar + 639] * main3_ .tas[iar + 703]);
	    alf0s3 = -(main3_ .tas[iar + 1023] * main3_ .tas[iar + 1087] + 
		    main3_ .tas[iar + 1407] * main3_ .tas[iar + 1471]);
	    i__3 = tra1_ .napx;
	    for (ib1 = 1; ib1 <= i__3; ++ib1) {
		iar = ib1 + (m + ib - 2) * tra1_ .napx;
		for (ib2 = 1; ib2 <= 6; ++ib2) {
		    for (ib3 = 1; ib3 <= 6; ++ib3) {
 
			main3_ .tau[ib2 + ib3 * 6 - 7] = main3_ .tas[iar + (
				ib3 + ib2 * 6 << 6) - 449];
		    }
		}
		if ((( main3_ .tau[0] ) >= 0 ? ( main3_ .tau[0] ) : -( main3_ .tau[0] ))  <= 1e-17 && (( main3_ .tau[7] ) >= 0 ? ( main3_ .tau[7] ) : -( main3_ .tau[7] ))  <= 
			1e-17) {
		    main3_ .tau[0] = 1.;
		    main3_ .tau[7] = 1.;
		}
		if ((( main3_ .tau[14] ) >= 0 ? ( main3_ .tau[14] ) : -( main3_ .tau[14] ))  <= 1e-17 && (( main3_ .tau[21] ) >= 0 ? ( main3_ .tau[21] ) : -( main3_ .tau[21] ))  <= 
			1e-17) {
		    main3_ .tau[14] = 1.;
		    main3_ .tau[21] = 1.;
		}
		if ((( main3_ .tau[28] ) >= 0 ? ( main3_ .tau[28] ) : -( main3_ .tau[28] ))  <= 1e-17 && (( main3_ .tau[35] ) >= 0 ? ( main3_ .tau[35] ) : -( main3_ .tau[35] ))  <= 
			1e-17) {
		    main3_ .tau[28] = 1.;
		    main3_ .tau[35] = 1.;
		    dinv_(&c__6, main3_ .tau, &c__6, rdummy, &nerror);
		    cor_ .its6d = 0;
		    if (tra1_ .ntwin != 2) {
			taus = (( main3_ .tau[4] ) >= 0 ? ( main3_ .tau[4] ) : -( main3_ .tau[4] ))  + (( main3_ .tau[10] ) >= 0 ? ( main3_ .tau[10] ) : -( main3_ .tau[10] ))  + 
				(( main3_ .tau[16] ) >= 0 ? ( main3_ .tau[16] ) : -( main3_ .tau[16] ))  + (( main3_ .tau[22] ) >= 0 ? ( main3_ .tau[22] ) : -( main3_ .tau[22] ))  + 
				(( main3_ .tau[28] ) >= 0 ? ( main3_ .tau[28] ) : -( main3_ .tau[28] ))  + (( main3_ .tau[34] ) >= 0 ? ( main3_ .tau[34] ) : -( main3_ .tau[34] ))  + 
				(( main3_ .tau[5] ) >= 0 ? ( main3_ .tau[5] ) : -( main3_ .tau[5] ))  + (( main3_ .tau[11] ) >= 0 ? ( main3_ .tau[11] ) : -( main3_ .tau[11] ))  + 
				(( main3_ .tau[17] ) >= 0 ? ( main3_ .tau[17] ) : -( main3_ .tau[17] ))  + (( main3_ .tau[23] ) >= 0 ? ( main3_ .tau[23] ) : -( main3_ .tau[23] ))  + 
				(( main3_ .tau[29] ) >= 0 ? ( main3_ .tau[29] ) : -( main3_ .tau[29] ))  + (( main3_ .tau[35] ) >= 0 ? ( main3_ .tau[35] ) : -( main3_ .tau[35] ))  + 
				(( main3_ .tau[24] ) >= 0 ? ( main3_ .tau[24] ) : -( main3_ .tau[24] ))  + (( main3_ .tau[25] ) >= 0 ? ( main3_ .tau[25] ) : -( main3_ .tau[25] ))  + 
				(( main3_ .tau[26] ) >= 0 ? ( main3_ .tau[26] ) : -( main3_ .tau[26] ))  + (( main3_ .tau[27] ) >= 0 ? ( main3_ .tau[27] ) : -( main3_ .tau[27] ))  + 
				(( main3_ .tau[30] ) >= 0 ? ( main3_ .tau[30] ) : -( main3_ .tau[30] ))  + (( main3_ .tau[31] ) >= 0 ? ( main3_ .tau[31] ) : -( main3_ .tau[31] ))  + 
				(( main3_ .tau[32] ) >= 0 ? ( main3_ .tau[32] ) : -( main3_ .tau[32] ))  + (( main3_ .tau[33] ) >= 0 ? ( main3_ .tau[33] ) : -( main3_ .tau[33] ))  - 
				2.;
			if ((( taus ) >= 0 ? ( taus ) : -( taus ))  >= 1e-17) {
			    cor_ .its6d = 1;
			}
		    }
		    for (ib2 = 1; ib2 <= 6; ++ib2) {
			for (ib3 = 1; ib3 <= 6; ++ib3) {
			    main3_ .tasau[iar + (ib2 + ib3 * 6 << 6) - 449] = 
				    main3_ .tau[ib2 + ib3 * 6 - 7];
 
			}
		    }
		}
 
	    }
	    if (erro_ .ierro != 0) {
		s_wsfe(&io___2854);
		do_fio(&c__1, (char *)& anf_ .dp1, (ftnlen)sizeof(doublereal));
		e_wsfe();
		goto L520;
	    }
	    s_wsfe(&io___2855);
	    e_wsfe();
	    phag = syn_ .phas * 180 / kons_ .pi;
	    if (syn_ .idp == 0 || (( syn_ .phas ) >= 0 ? ( syn_ .phas ) : -( syn_ .phas ))  <= 1e-17 && syn_ .ition == 
		    0) {
		s_wsfe(&io___2857);
		do_fio(&c__1, (char *)& main1_ .qwc[0], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)& (tra_._1) .clo[0], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)& (tra_._1) .clop[0], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)& (tra_._1) .bet0[0], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)& (tra_._1) .alf0[0], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)&gam0x1, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)&bet0x2, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)&alf0x2, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)&gam0x2, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& main1_ .qwc[1], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)& (tra_._1) .clo[1], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)& (tra_._1) .clop[1], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)& (tra_._1) .bet0[1], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)& (tra_._1) .alf0[1], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)&gam0z1, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)&bet0z2, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)&alf0z2, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)&gam0z2, (ftnlen)sizeof(doublereal));
		e_wsfe();
	    }
	    if (syn_ .idp == 1 && iation == 1 && (( syn_ .phas ) >= 0 ? ( syn_ .phas ) : -( syn_ .phas ))  > 1e-17) {
		if (tra1_ .iclo6 == 0) {
		    s_wsfe(&io___2858);
		    do_fio(&c__1, (char *)&phag, (ftnlen)sizeof(doublereal));
		    do_fio(&c__1, (char *)& main1_ .qwc[0], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& (tra_._1) .clo[0], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& (tra_._1) .clop[0], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& (tra_._1) .bet0[0], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& (tra_._1) .alf0[0], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)&gam0x1, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&bet0x2, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&alf0x2, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&gam0x2, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)& main1_ .qwc[1], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& (tra_._1) .clo[1], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& (tra_._1) .clop[1], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& (tra_._1) .bet0[1], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& (tra_._1) .alf0[1], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)&gam0z1, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&bet0z2, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&alf0z2, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&gam0z2, (ftnlen)sizeof(doublereal))
			    ;
		    e_wsfe();
		} else {
		    s_wsfe(&io___2859);
		    do_fio(&c__1, (char *)&phag, (ftnlen)sizeof(doublereal));
		    do_fio(&c__1, (char *)& main1_ .qwc[0], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& co6d_ .clo6[0], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& co6d_ .clop6[0], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& (tra_._1) .bet0[0], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& (tra_._1) .alf0[0], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)&gam0x1, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&bet0x2, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&alf0x2, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&gam0x2, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&bet0x3, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&alf0x3, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&gam0x3, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)& main1_ .qwc[1], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& co6d_ .clo6[1], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& co6d_ .clop6[1], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& (tra_._1) .bet0[1], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& (tra_._1) .alf0[1], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)&gam0z1, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&bet0z2, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&alf0z2, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&gam0z2, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&bet0z3, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&alf0z3, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&gam0z3, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)& main1_ .qwc[2], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& co6d_ .clo6[2], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& co6d_ .clop6[2], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)&bet0s1, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&alf0s1, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&gam0s1, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&bet0s2, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&alf0s2, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&gam0s2, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&bet0s3, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&alf0s3, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&gam0s3, (ftnlen)sizeof(doublereal))
			    ;
		    e_wsfe();
		}
	    }
	    if (syn_ .idp == 1 && syn_ .ition == 0 && (( syn_ .phas ) >= 0 ? ( syn_ .phas ) : -( syn_ .phas ))  > 1e-17)
		     {
		s_wsfe(&io___2860);
		do_fio(&c__1, (char *)&phag, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& main1_ .qwc[0], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)& (tra_._1) .clo[0], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)& (tra_._1) .clop[0], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)& (tra_._1) .bet0[0], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)& (tra_._1) .alf0[0], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)&gam0x1, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)&bet0x2, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)&alf0x2, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)&gam0x2, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& main1_ .qwc[1], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)& (tra_._1) .clo[1], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)& (tra_._1) .clop[1], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)& (tra_._1) .bet0[1], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)& (tra_._1) .alf0[1], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)&gam0z1, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)&bet0z2, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)&alf0z2, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)&gam0z2, (ftnlen)sizeof(doublereal));
		e_wsfe();
	    }
	    if (syn_ .idp == 1 && (( syn_ .phas ) >= 0 ? ( syn_ .phas ) : -( syn_ .phas ))  <= 1e-17 && iation == 1) {
		if (tra1_ .iclo6 == 0) {
		    s_wsfe(&io___2861);
		    do_fio(&c__1, (char *)& main1_ .qwc[0], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& (tra_._1) .clo[0], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& (tra_._1) .clop[0], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& (tra_._1) .bet0[0], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& (tra_._1) .alf0[0], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)&gam0x1, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&bet0x2, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&alf0x2, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&gam0x2, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)& main1_ .qwc[1], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& (tra_._1) .clo[1], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& (tra_._1) .clop[1], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& (tra_._1) .bet0[1], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& (tra_._1) .alf0[1], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)&gam0z1, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&bet0z2, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&alf0z2, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&gam0z2, (ftnlen)sizeof(doublereal))
			    ;
		    e_wsfe();
		} else {
		    s_wsfe(&io___2862);
		    do_fio(&c__1, (char *)& main1_ .qwc[0], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& co6d_ .clo6[0], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& co6d_ .clop6[0], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& (tra_._1) .bet0[0], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& (tra_._1) .alf0[0], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)&gam0x1, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&bet0x2, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&alf0x2, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&gam0x2, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&bet0x3, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&alf0x3, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&gam0x3, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)& main1_ .qwc[1], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& co6d_ .clo6[1], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& co6d_ .clop6[1], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& (tra_._1) .bet0[1], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& (tra_._1) .alf0[1], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)&gam0z1, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&bet0z2, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&alf0z2, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&gam0z2, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&bet0z3, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&alf0z3, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&gam0z3, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)& main1_ .qwc[2], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& co6d_ .clo6[2], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)& co6d_ .clop6[2], (ftnlen)sizeof(
			    doublereal));
		    do_fio(&c__1, (char *)&bet0s1, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&alf0s1, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&gam0s1, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&bet0s2, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&alf0s2, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&gam0s2, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&bet0s3, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&alf0s3, (ftnlen)sizeof(doublereal))
			    ;
		    do_fio(&c__1, (char *)&gam0s3, (ftnlen)sizeof(doublereal))
			    ;
		    e_wsfe();
		}
	    }
	    s_wsfe(&io___2863);
	    do_fio(&c__1, (char *)& anf_ .dp1, (ftnlen)sizeof(doublereal));
	    e_wsfe();
	    main4_ .e0f = sqrt(syn_ .e0 * syn_ .e0 - syn_ .pma * syn_ .pma);
	    if (tra1_ .iclo6 == 0) {
		s_wsfe(&io___2864);
		do_fio(&c__1, (char *)& (tra_._1) .clo[0], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)& (tra_._1) .clop[0], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)& (tra_._1) .clo[1], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)& (tra_._1) .clop[1], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)& syos_ .idz[0], (ftnlen)sizeof(integer))
			;
		do_fio(&c__1, (char *)& syos_ .idz[1], (ftnlen)sizeof(integer))
			;
		do_fio(&c__1, (char *)& tra1_ .iver, (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)& tra1_ .idfor, (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)& tra1_ .iclo6, (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)& syn_ .ition, (ftnlen)sizeof(integer));
		e_wsfe();
	    } else {
		s_wsfe(&io___2865);
		do_fio(&c__1, (char *)& co6d_ .clo6[0], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)& co6d_ .clop6[0], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)& co6d_ .clo6[1], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)& co6d_ .clop6[1], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)& co6d_ .clo6[2], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)& co6d_ .clop6[2], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)& syos_ .idz[0], (ftnlen)sizeof(integer))
			;
		do_fio(&c__1, (char *)& syos_ .idz[1], (ftnlen)sizeof(integer))
			;
		do_fio(&c__1, (char *)& tra1_ .iver, (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)& tra1_ .idfor, (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)& tra1_ .iclo6, (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)& syn_ .ition, (ftnlen)sizeof(integer));
		e_wsfe();
	    }
	    i__3 = tra1_ .napx;
	    for (ib1 = 1; ib1 <= i__3; ++ib1) {
		ib2 = ib0 + ib1;
		main2_ .clov[(ib2 << 1) - 2] = (tra_._1) .clo[0];
		main2_ .clov[(ib2 << 1) - 1] = (tra_._1) .clo[1];
		main2_ .clopv[(ib2 << 1) - 2] = (tra_._1) .clop[0];
		main2_ .clopv[(ib2 << 1) - 1] = (tra_._1) .clop[1];
		main2_ .bet0v[ib2 - 1] = (tra_._1) .bet0[0];
		main2_ .bet0v[ib2 + 63] = (tra_._1) .bet0[1];
		main2_ .alf0v[ib2 - 1] = (tra_._1) .alf0[0];
		main2_ .alf0v[ib2 + 63] = (tra_._1) .alf0[1];
		main2_ .ampv[ib2 - 1] = (tra_._1) .amp[0] - damp_ .damp * (ib1 - 1)
			;
		main1_ .dp0v[ib2 - 1] = dp10;
		main1_ .dpsv[ib2 - 1] = dp10;
		main2_ .oidpsv[ib2 - 1] = 1. / (anf_ .dp1 + 1.);
		main1_ .nms[ib2 - 1] = m;
		for (i__ = 1; i__ <= 700; ++i__) {
		    main1_ .ekv[ib2 + (i__ << 6) - 65] = ell_ .ek[i__ - 1];
 
		}
 
	    }
 
	    i__3 = tra1_ .napx;
	    for (ib1 = 1; ib1 <= i__3; ++ib1) {
		ib2 = ib0 + ib1;
		if (beam_ .nbeam >= 1) {
		    beam_ .nvbeam = ib2;
		    ncorruo = clos_ .ncorru;
		    clos_ .ncorru = 1;
		    if (tra1_ .iclo6 == 0) {
			linopt_(&c_b251);
		    } else {
			linopt_(& co6d_ .clop6[2]);
		    }
		    clos_ .ncorru = ncorruo;
		}
 
	    }
	    ib0 += tra1_ .napx;
 
	}
 
    }
    if (ripp_ .irip == 1) {
	i__1 = str_ .iu;
	for (i__ = 1; i__ <= i__1; ++i__) {
	    ix = str_ .ic[i__ - 1];
	    if (ix <= 300) {
		goto L280;
	    }
	    ix += -300;
	    i__2 = ripp_ .irco;
	    for (j = 1; j <= i__2; ++j) {
		jj = ripp_ .nrel[j - 1];
		if (ix == jj) {
		    rfres_ .rsmi[i__ - 1] = ripp_ .ramp[jj - 1];
		    rfres_ .rfres[i__ - 1] = ripp_ .rfre[jj - 1];
		    rfres_ .rzphs[i__ - 1] = ripp_ .rzph[jj - 1];
		}
 
	    }
L280:
	    ;
	}
    }
    tra1_ .napx = tra1_ .napx * tra1_ .imc * rand0_ .mmac;
    tra1_ .napxo = tra1_ .napx;
    if (tra1_ .ibidu == 1) {
	s_wsue(&io___2868);
	do_uio(&c__1, (char *)& erro_ .ierro, (ftnlen)sizeof(integer));
	do_uio(&c__1, erroc_ .erbez, 16L);
	do_uio(&c__1, (char *)& kons_ .pi, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& kons_ .pi2, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& kons_ .pisqrt, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& kons_ .rad, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& str_ .il, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& str_ .mper, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& str_ .mblo, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& str_ .mbloz, (ftnlen)sizeof(integer));
	do_uio(&c__16, (char *)& str_ .msym[0], (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& str_ .kanf, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& str_ .iu, (ftnlen)sizeof(integer));
	do_uio(&c__20000, (char *)& str_ .ic[0], (ftnlen)sizeof(integer));
	do_uio(&c__700, (char *)& ell_ .ed[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__700, (char *)& ell_ .el[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__700, (char *)& ell_ .ek[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__700, (char *)& ell_ .sm[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__700, (char *)& ell_ .kz[0], (ftnlen)sizeof(integer));
	do_uio(&c__700, (char *)& ell_ .kp[0], (ftnlen)sizeof(integer));
	do_uio(&c__700, (char *)& pla_ .xpl[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__700, (char *)& pla_ .xrms[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__700, (char *)& pla_ .zpl[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__700, (char *)& pla_ .zrms[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__300, (char *)& str2_ .mel[0], (ftnlen)sizeof(integer));
	do_uio(&c__30000, (char *)& str2_ .mtyp[0], (ftnlen)sizeof(integer));
	do_uio(&c__300, (char *)& str2_ .mstr[0], (ftnlen)sizeof(integer));
	do_uio(&c__8400, (char *)& mat_ .a[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__3600, (char *)& mat_ .bl1[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__3600, (char *)& mat_ .bl2[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__6, (char *)& syos2_ .rvf[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& tra1_ .idfor, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tra1_ .napx, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tra1_ .napxo, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tra1_ .numlr, (ftnlen)sizeof(integer));
	do_uio(&c__2, (char *)& tra1_ .nde[0], (ftnlen)sizeof(integer));
	do_uio(&c__4, (char *)& tra1_ .nwr[0], (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tra1_ .ird, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tra1_ .imc, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tra1_ .irew, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tra1_ .ntwin, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tra1_ .iclo6, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tra1_ .iclo6r, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tra1_ .iver, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tra1_ .ibidu, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& syn_ .qs, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& syn_ .e0, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& syn_ .pma, (ftnlen)sizeof(doublereal));
	do_uio(&c__6, (char *)& syn_ .ej[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__6, (char *)& syn_ .ejf[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& syn_ .phas0, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& syn_ .phas, (ftnlen)sizeof(doublereal));
	do_uio(&c__3, (char *)& syn_ .hsy[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& syn_ .crad, (ftnlen)sizeof(doublereal));
	do_uio(&c__700, (char *)& syn_ .hsyc[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__700, (char *)& syn_ .phasc[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& syn_ .dppoff, (ftnlen)sizeof(doublereal));
	do_uio(&c__20000, (char *)& syn_ .sigmoff[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__1, (char *)& syn_ .tlen, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& syn_ .iicav, (ftnlen)sizeof(integer));
	do_uio(&c__700, (char *)& syn_ .itionc[0], (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& syn_ .ition, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& syn_ .idp, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& syn_ .ncy, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& syn_ .ixcav, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& cor_ .dpscor, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& cor_ .sigcor, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& cor_ .icode, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& cor_ .idam, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& cor_ .its6d, (ftnlen)sizeof(integer));
	do_uio(&c__7700, (char *)& multi_ .bk0[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__7700, (char *)& multi_ .ak0[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__7700, (char *)& multi_ .bka[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__7700, (char *)& multi_ .aka[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& mult1_ .benki, (ftnlen)sizeof(doublereal));
	do_uio(&c__700, (char *)& mult1_ .benkc[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__700, (char *)& mult1_ .r00[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__700, (char *)& mult1_ .irm[0], (ftnlen)sizeof(integer));
	do_uio(&c__700, (char *)& mult1_ .nmu[0], (ftnlen)sizeof(integer));
	do_uio(&c_b1102, (char *)& rand0_ .zfz[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& rand0_ .iorg, (ftnlen)sizeof(integer));
	do_uio(&c__20000, (char *)& rand0_ .mzu[0], (ftnlen)sizeof(integer));
	do_uio(&c__2100, rand0c_ .bezr, 16L);
	do_uio(&c__1, (char *)& rand0_ .izu0, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& rand0_ .mmac, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& rand0_ .mcut, (ftnlen)sizeof(integer));
	do_uio(&c_b6183, (char *)& rand1_ .exterr[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__60000, (char *)& rand1_ .extalign[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__20000, (char *)& rand1_ .tiltc[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__20000, (char *)& rand1_ .tilts[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__1, (char *)& rand1_ .mout2, (ftnlen)sizeof(integer));
	do_uio(&c__20000, (char *)& rand1_ .icext[0], (ftnlen)sizeof(integer));
	do_uio(&c__20000, (char *)& rand1_ .icextal[0], (ftnlen)sizeof(integer)
		);
	do_uio(&c__2, (char *)& beo_ .aper[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& beo_ .di0[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& beo_ .dip0[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__36, (char *)& beo_ .ta[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& clo_ .dma, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& clo_ .dmap, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& clo_ .dkq, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& clo_ .dqq, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& clo_ .de0, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& clo_ .ded, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& clo_ .dsi, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& clo_ .dech, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& clo_ .dsm0, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& clo_ .itco, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& clo_ .itcro, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& clo_ .itqv, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& clo_ .iout, (ftnlen)sizeof(integer));
	do_uio(&c__3, (char *)& qmodi_ .qw0[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__3, (char *)& qmodi_ .iq[0], (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& qmodi_ .iqmod, (ftnlen)sizeof(integer));
	do_uio(&c__700, (char *)& qmodi_ .kpa[0], (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& qmodi_ .iqmod6, (ftnlen)sizeof(integer));
	do_uio(&c__700, linopc_ .bez, 16L);
	do_uio(&c__300, (char *)& linop_ .elbe[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__300, linopc_ .bezb, 16L);
	do_uio(&c__1, (char *)& linop_ .ilin, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& linop_ .nt, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& linop_ .iprint, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& linop_ .ntco, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& linop_ .eui, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& linop_ .euii, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& linop_ .nlin, (ftnlen)sizeof(integer));
	do_uio(&c__700, linopc_ .bezl, 16L);
	do_uio(&c__1200, (char *)& cororb_ .betam[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__1200, (char *)& cororb_ .pam[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__1200, (char *)& cororb_ .betac[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__1200, (char *)& cororb_ .pac[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__1200, (char *)& cororb_ .bclorb[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__1, (char *)& cororb_ .nhmoni, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& cororb_ .nhcorr, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& cororb_ .nvmoni, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& cororb_ .nvcorr, (ftnlen)sizeof(integer));
	do_uio(&c__700, (char *)& cororb_ .ncororb[0], (ftnlen)sizeof(integer))
		;
	do_uio(&c__700, (char *)& apert_ .apx[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__700, (char *)& apert_ .apz[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& clos_ .sigma0[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& clos_ .iclo, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& clos_ .ncorru, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& clos_ .ncorrep, (ftnlen)sizeof(integer));
	do_uio(&c__20, (char *)& combin_ .icomb0[0], (ftnlen)sizeof(integer));
	do_uio(&c__2000, (char *)& combin_ .icomb[0], (ftnlen)sizeof(integer));
	do_uio(&c__2000, (char *)& combin_ .ratio[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__700, (char *)& combin_ .ratioe[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__1, (char *)&iratioeicoe, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& sea_ .ise, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& sea_ .mesa, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& sea_ .mp, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& sea_ .m21, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& sea_ .m22, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& sea_ .m23, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& sea_ .ise1, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& sea_ .ise2, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& sea_ .ise3, (ftnlen)sizeof(integer));
	do_uio(&c__700, (char *)& sea_ .isea[0], (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& subres_ .qxt, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& subres_ .qzt, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& subres_ .tam1, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& subres_ .tam2, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& subres_ .isub, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& subres_ .nta, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& subres_ .nte, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& subres_ .ipt, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& subres_ .totl, (ftnlen)sizeof(doublereal));
	do_uio(&c__8100, (char *)& secom_ .rtc[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__8100, (char *)& secom_ .rts[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__12, (char *)& secom_ .ire[0], (ftnlen)sizeof(integer));
	do_uio(&c__5, (char *)& secom_ .ipr[0], (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& secom_ .irmod2, (ftnlen)sizeof(integer));
	do_uio(&c__10, (char *)& secom1_ .dtr[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& secom1_ .nre, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& secom1_ .nur, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& secom1_ .nch, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& secom1_ .nqc, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& secom1_ .npp, (ftnlen)sizeof(integer));
	do_uio(&c__5, (char *)& secom1_ .nrr[0], (ftnlen)sizeof(integer));
	do_uio(&c__5, (char *)& secom1_ .nu[0], (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& postr_ .dphix, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& postr_ .dphiz, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& postr_ .qx0, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& postr_ .qz0, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& postr_ .dres, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& postr_ .dfft, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& postr_ .cma1, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& postr_ .cma2, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& postr_ .nstart, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& postr_ .nstop, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& postr_ .iskip, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& postr_ .iconv, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& postr_ .imad, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& posti1_ .ipos, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& posti1_ .iav, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& posti1_ .iwg, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& posti1_ .ivox, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& posti1_ .ivoz, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& posti1_ .ires, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& posti1_ .ifh, (ftnlen)sizeof(integer));
	do_uio(&c__5, posti3_ .toptit, 80L);
	do_uio(&c__1, (char *)& posti2_ .kwtype, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& posti2_ .itf, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& posti2_ .icr, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& posti2_ .idis, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& posti2_ .icow, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& posti2_ .istw, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& posti2_ .iffw, (ftnlen)sizeof(integer));
	e_wsue();

 
 


	s_wsue(&io___2870);
	do_uio(&c__1, (char *)& posti2_ .nprint, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& posti2_ .ndafi, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& ripp_ .irip, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& ripp_ .irco, (ftnlen)sizeof(integer));
	do_uio(&c__700, (char *)& ripp_ .ramp[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__700, (char *)& ripp_ .rfre[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__700, (char *)& ripp_ .rzph[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__700, (char *)& ripp_ .nrel[0], (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& ripp2_ .nrturn, (ftnlen)sizeof(integer));
	do_uio(&c__2, (char *)& skew_ .qwsk[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& skew_ .betx[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& skew_ .betz[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& skew_ .alfx[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& skew_ .alfz[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& skew_ .iskew, (ftnlen)sizeof(integer));
	do_uio(&c__6, (char *)& skew_ .nskew[0], (ftnlen)sizeof(integer));
	do_uio(&c__1, titc_ .sixtit, 80L);
	do_uio(&c__1, titc_ .commen, 80L);
	do_uio(&c__1, (char *)& tit_ .ithick, (ftnlen)sizeof(integer));
	do_uio(&c__3, (char *)& co6d_ .clo6[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__3, (char *)& co6d_ .clop6[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2100, (char *)& dkic_ .dki[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__1400, (char *)& beam_ .clobaux[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__89600, (char *)& beam_ .sigman[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__1400, (char *)& beam_ .sigman6[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__89600, (char *)& beam_ .sigman2[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__89600, (char *)& beam_ .sigmanq[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__89600, (char *)& beam_ .clobeam[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__89600, (char *)& beam_ .beamoff[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__1, (char *)& beam_ .partnum, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& beam_ .emitnx, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& beam_ .emitnz, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& beam_ .gammar, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& beam_ .nbeam, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& beam_ .nvbeam, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& beam_ .ibeco, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& beam_ .ibtyp, (ftnlen)sizeof(integer));
	do_uio(&c_b6341, (char *)& syos_ .as[0], (ftnlen)sizeof(doublereal));
	do_uio(&c_b6341, (char *)& syos_ .al[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__6, (char *)& syos_ .sigm[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__6, (char *)& syos_ .dps[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& syos_ .idz[0], (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& anf_ .dp1, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& anf_ .itra, (ftnlen)sizeof(integer));
	do_uio(&c__12, (char *)& (tra_._1) .x[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__12, (char *)& (tra_._1) .y[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& (tra_._1) .bet0[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& (tra_._1) .alf0[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& (tra_._1) .clo[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& (tra_._1) .clop[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& (chrom_._1) .cro[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& (chrom_._1) .is[0], (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& (chrom_._1) .ichrom, (ftnlen)sizeof(integer));
	do_uio(&c__20000, (char *)& xz_ .xsi[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__20000, (char *)& xz_ .zsi[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__20000, (char *)& xz_ .smi[0], (ftnlen)sizeof(doublereal));
	do_uio(&c_b6360, (char *)& xz_ .aai[0], (ftnlen)sizeof(doublereal));
	do_uio(&c_b6360, (char *)& xz_ .bbi[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__20000, (char *)& rfres_ .rsmi[0], (ftnlen)sizeof(doublereal)
		);
	do_uio(&c__20000, (char *)& rfres_ .rfres[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__20000, (char *)& rfres_ .rzphs[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__1, (char *)& damp_ .ampt, (ftnlen)sizeof(doublereal));
	do_uio(&c__36, (char *)& tasm_ .tasm[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& dial_ .preda, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& dial_ .idial, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& dial_ .nord, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& dial_ .nvar, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& dial_ .nvar2, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& dial_ .nsix, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& dial_ .ncor, (ftnlen)sizeof(integer));
	do_uio(&c__10, (char *)& dial_ .ipar[0], (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& dial_ .idalloc, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& norf_ .nordf, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& norf_ .nvarf, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& norf_ .inorm, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& norf_ .imod1, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& norf_ .imod2, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tcorr_ .icorr, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tcorr_ .nctype, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tcorr_ .namp, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tcorr_ .nmom, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tcorr_ .nmom1, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tcorr_ .nmom2, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tcorr_ .weig1, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& tcorr_ .weig2, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& tcorr_ .dpmax, (ftnlen)sizeof(doublereal));
	do_uio(&c__10, tcorrc_ .coel, 16L);
	do_uio(&c__44800, (char *)& main1_ .ekv[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__64, (char *)& main1_ .fokqv[0], (ftnlen)sizeof(doublereal));
	do_uio(&c_b6360, (char *)& main1_ .aaiv[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c_b6360, (char *)& main1_ .bbiv[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__20000, (char *)& main1_ .smiv[0], (ftnlen)sizeof(doublereal)
		);
	do_uio(&c__20000, (char *)& main1_ .zsiv[0], (ftnlen)sizeof(doublereal)
		);
	do_uio(&c__20000, (char *)& main1_ .xsiv[0], (ftnlen)sizeof(doublereal)
		);
	do_uio(&c__64, (char *)& main1_ .xsv[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main1_ .zsv[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& main1_ .qw[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__3, (char *)& main1_ .qwc[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& main1_ .clo0[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& main1_ .clop0[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& main1_ .eps[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& main1_ .epsa[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& main1_ .ekk[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__11, (char *)& main1_ .cr[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__11, (char *)& main1_ .ci[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__128, (char *)& main1_ .xv[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__128, (char *)& main1_ .yv[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main1_ .dam[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main1_ .ekkv[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main1_ .sigmv[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main1_ .dpsv[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main1_ .dp0v[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main1_ .sigmv6[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__64, (char *)& main1_ .dpsv6[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main1_ .ejv[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main1_ .ejfv[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main1_ .xlv[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main1_ .zlv[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main1_ .pstop[0], (ftnlen)sizeof(logical));
	do_uio(&c__64, (char *)& main1_ .rvv[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main1_ .ejf0v[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main1_ .nms[0], (ftnlen)sizeof(integer));
	do_uio(&c__64, (char *)& main1_ .nlostp[0], (ftnlen)sizeof(integer));
	do_uio(&c__64, (char *)& main2_ .dpd[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .dpsq[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .fok[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .rho[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .fok1[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .si[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .co[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .g[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .gl[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .sm1[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .sm2[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .sm3[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .sm12[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .as3[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .as4[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .as6[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .sm23[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .rhoc[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .siq[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .aek[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .afok[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .hp[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .hm[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .hc[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .hs[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .wf[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .wfa[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .wfhi[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .rhoi[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .hi[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .fi[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .hi1[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__128, (char *)& main2_ .xvl[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__128, (char *)& main2_ .yvl[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .ejvl[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .dpsvl[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .oidpsv[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__64, (char *)& main2_ .sigmvl[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__64, (char *)& main2_ .iv[0], (ftnlen)sizeof(integer));
	do_uio(&c__128, (char *)& main2_ .aperv[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__64, (char *)& main2_ .ixv[0], (ftnlen)sizeof(integer));
	do_uio(&c__128, (char *)& main2_ .clov[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__128, (char *)& main2_ .clopv[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__128, (char *)& main2_ .alf0v[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__128, (char *)& main2_ .bet0v[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__64, (char *)& main2_ .ampv[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__192, (char *)& main3_ .clo6v[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__192, (char *)& main3_ .clop6v[0], (ftnlen)sizeof(doublereal)
		);
	do_uio(&c_b6475, (char *)& main3_ .hv[0], (ftnlen)sizeof(doublereal));
	do_uio(&c_b6475, (char *)& main3_ .bl1v[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__2304, (char *)& main3_ .tas[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__192, (char *)& main3_ .qwcs[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main3_ .di0xs[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main3_ .di0zs[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main3_ .dip0xs[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__64, (char *)& main3_ .dip0zs[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__12, (char *)& main3_ .xau[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__6, (char *)& main3_ .cloau[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__4, (char *)& main3_ .di0au[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__36, (char *)& main3_ .tau[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2304, (char *)& main3_ .tasau[0], (ftnlen)sizeof(doublereal)
		);
	do_uio(&c__3, (char *)& main3_ .wx[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__6, (char *)& main3_ .x1[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__6, (char *)& main3_ .x2[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__40, (char *)& main3_ .fake[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& main4_ .e0f, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& main4_ .numx, (ftnlen)sizeof(integer));
	e_wsue();
    }
L550:
    if (tra1_ .ibidu == 2) {
	s_rsue(&io___2871);
	do_uio(&c__1, (char *)& erro_ .ierro, (ftnlen)sizeof(integer));
	do_uio(&c__1, erroc_ .erbez, 16L);
	do_uio(&c__1, (char *)& kons_ .pi, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& kons_ .pi2, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& kons_ .pisqrt, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& kons_ .rad, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& str_ .il, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& str_ .mper, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& str_ .mblo, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& str_ .mbloz, (ftnlen)sizeof(integer));
	do_uio(&c__16, (char *)& str_ .msym[0], (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& str_ .kanf, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& str_ .iu, (ftnlen)sizeof(integer));
	do_uio(&c__20000, (char *)& str_ .ic[0], (ftnlen)sizeof(integer));
	do_uio(&c__700, (char *)& ell_ .ed[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__700, (char *)& ell_ .el[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__700, (char *)& ell_ .ek[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__700, (char *)& ell_ .sm[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__700, (char *)& ell_ .kz[0], (ftnlen)sizeof(integer));
	do_uio(&c__700, (char *)& ell_ .kp[0], (ftnlen)sizeof(integer));
	do_uio(&c__700, (char *)& pla_ .xpl[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__700, (char *)& pla_ .xrms[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__700, (char *)& pla_ .zpl[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__700, (char *)& pla_ .zrms[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__300, (char *)& str2_ .mel[0], (ftnlen)sizeof(integer));
	do_uio(&c__30000, (char *)& str2_ .mtyp[0], (ftnlen)sizeof(integer));
	do_uio(&c__300, (char *)& str2_ .mstr[0], (ftnlen)sizeof(integer));
	do_uio(&c__8400, (char *)& mat_ .a[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__3600, (char *)& mat_ .bl1[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__3600, (char *)& mat_ .bl2[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__6, (char *)& syos2_ .rvf[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& tra1_ .idfor, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tra1_ .napx, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tra1_ .napxo, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tra1_ .numlr, (ftnlen)sizeof(integer));
	do_uio(&c__2, (char *)& tra1_ .nde[0], (ftnlen)sizeof(integer));
	do_uio(&c__4, (char *)& tra1_ .nwr[0], (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tra1_ .ird, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tra1_ .imc, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tra1_ .irew, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tra1_ .ntwin, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tra1_ .iclo6, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tra1_ .iclo6r, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tra1_ .iver, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tra1_ .ibidu, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& syn_ .qs, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& syn_ .e0, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& syn_ .pma, (ftnlen)sizeof(doublereal));
	do_uio(&c__6, (char *)& syn_ .ej[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__6, (char *)& syn_ .ejf[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& syn_ .phas0, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& syn_ .phas, (ftnlen)sizeof(doublereal));
	do_uio(&c__3, (char *)& syn_ .hsy[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& syn_ .crad, (ftnlen)sizeof(doublereal));
	do_uio(&c__700, (char *)& syn_ .hsyc[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__700, (char *)& syn_ .phasc[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& syn_ .dppoff, (ftnlen)sizeof(doublereal));
	do_uio(&c__20000, (char *)& syn_ .sigmoff[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__1, (char *)& syn_ .tlen, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& syn_ .iicav, (ftnlen)sizeof(integer));
	do_uio(&c__700, (char *)& syn_ .itionc[0], (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& syn_ .ition, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& syn_ .idp, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& syn_ .ncy, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& syn_ .ixcav, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& cor_ .dpscor, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& cor_ .sigcor, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& cor_ .icode, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& cor_ .idam, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& cor_ .its6d, (ftnlen)sizeof(integer));
	do_uio(&c__7700, (char *)& multi_ .bk0[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__7700, (char *)& multi_ .ak0[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__7700, (char *)& multi_ .bka[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__7700, (char *)& multi_ .aka[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& mult1_ .benki, (ftnlen)sizeof(doublereal));
	do_uio(&c__700, (char *)& mult1_ .benkc[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__700, (char *)& mult1_ .r00[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__700, (char *)& mult1_ .irm[0], (ftnlen)sizeof(integer));
	do_uio(&c__700, (char *)& mult1_ .nmu[0], (ftnlen)sizeof(integer));
	do_uio(&c_b1102, (char *)& rand0_ .zfz[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& rand0_ .iorg, (ftnlen)sizeof(integer));
	do_uio(&c__20000, (char *)& rand0_ .mzu[0], (ftnlen)sizeof(integer));
	do_uio(&c__2100, rand0c_ .bezr, 16L);
	do_uio(&c__1, (char *)& rand0_ .izu0, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& rand0_ .mmac, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& rand0_ .mcut, (ftnlen)sizeof(integer));
	do_uio(&c_b6183, (char *)& rand1_ .exterr[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__60000, (char *)& rand1_ .extalign[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__20000, (char *)& rand1_ .tiltc[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__20000, (char *)& rand1_ .tilts[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__1, (char *)& rand1_ .mout2, (ftnlen)sizeof(integer));
	do_uio(&c__20000, (char *)& rand1_ .icext[0], (ftnlen)sizeof(integer));
	do_uio(&c__20000, (char *)& rand1_ .icextal[0], (ftnlen)sizeof(integer)
		);
	do_uio(&c__2, (char *)& beo_ .aper[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& beo_ .di0[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& beo_ .dip0[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__36, (char *)& beo_ .ta[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& clo_ .dma, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& clo_ .dmap, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& clo_ .dkq, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& clo_ .dqq, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& clo_ .de0, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& clo_ .ded, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& clo_ .dsi, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& clo_ .dech, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& clo_ .dsm0, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& clo_ .itco, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& clo_ .itcro, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& clo_ .itqv, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& clo_ .iout, (ftnlen)sizeof(integer));
	do_uio(&c__3, (char *)& qmodi_ .qw0[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__3, (char *)& qmodi_ .iq[0], (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& qmodi_ .iqmod, (ftnlen)sizeof(integer));
	do_uio(&c__700, (char *)& qmodi_ .kpa[0], (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& qmodi_ .iqmod6, (ftnlen)sizeof(integer));
	do_uio(&c__700, linopc_ .bez, 16L);
	do_uio(&c__300, (char *)& linop_ .elbe[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__300, linopc_ .bezb, 16L);
	do_uio(&c__1, (char *)& linop_ .ilin, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& linop_ .nt, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& linop_ .iprint, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& linop_ .ntco, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& linop_ .eui, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& linop_ .euii, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& linop_ .nlin, (ftnlen)sizeof(integer));
	do_uio(&c__700, linopc_ .bezl, 16L);
	do_uio(&c__1200, (char *)& cororb_ .betam[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__1200, (char *)& cororb_ .pam[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__1200, (char *)& cororb_ .betac[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__1200, (char *)& cororb_ .pac[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__1200, (char *)& cororb_ .bclorb[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__1, (char *)& cororb_ .nhmoni, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& cororb_ .nhcorr, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& cororb_ .nvmoni, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& cororb_ .nvcorr, (ftnlen)sizeof(integer));
	do_uio(&c__700, (char *)& cororb_ .ncororb[0], (ftnlen)sizeof(integer))
		;
	do_uio(&c__700, (char *)& apert_ .apx[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__700, (char *)& apert_ .apz[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& clos_ .sigma0[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& clos_ .iclo, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& clos_ .ncorru, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& clos_ .ncorrep, (ftnlen)sizeof(integer));
	do_uio(&c__20, (char *)& combin_ .icomb0[0], (ftnlen)sizeof(integer));
	do_uio(&c__2000, (char *)& combin_ .icomb[0], (ftnlen)sizeof(integer));
	do_uio(&c__2000, (char *)& combin_ .ratio[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__700, (char *)& combin_ .ratioe[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__1, (char *)&iratioeicoe, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& sea_ .ise, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& sea_ .mesa, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& sea_ .mp, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& sea_ .m21, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& sea_ .m22, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& sea_ .m23, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& sea_ .ise1, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& sea_ .ise2, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& sea_ .ise3, (ftnlen)sizeof(integer));
	do_uio(&c__700, (char *)& sea_ .isea[0], (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& subres_ .qxt, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& subres_ .qzt, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& subres_ .tam1, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& subres_ .tam2, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& subres_ .isub, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& subres_ .nta, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& subres_ .nte, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& subres_ .ipt, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& subres_ .totl, (ftnlen)sizeof(doublereal));
	do_uio(&c__8100, (char *)& secom_ .rtc[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__8100, (char *)& secom_ .rts[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__12, (char *)& secom_ .ire[0], (ftnlen)sizeof(integer));
	do_uio(&c__5, (char *)& secom_ .ipr[0], (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& secom_ .irmod2, (ftnlen)sizeof(integer));
	do_uio(&c__10, (char *)& secom1_ .dtr[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& secom1_ .nre, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& secom1_ .nur, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& secom1_ .nch, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& secom1_ .nqc, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& secom1_ .npp, (ftnlen)sizeof(integer));
	do_uio(&c__5, (char *)& secom1_ .nrr[0], (ftnlen)sizeof(integer));
	do_uio(&c__5, (char *)& secom1_ .nu[0], (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& postr_ .dphix, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& postr_ .dphiz, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& postr_ .qx0, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& postr_ .qz0, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& postr_ .dres, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& postr_ .dfft, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& postr_ .cma1, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& postr_ .cma2, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& postr_ .nstart, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& postr_ .nstop, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& postr_ .iskip, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& postr_ .iconv, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& postr_ .imad, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& posti1_ .ipos, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& posti1_ .iav, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& posti1_ .iwg, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& posti1_ .ivox, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& posti1_ .ivoz, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& posti1_ .ires, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& posti1_ .ifh, (ftnlen)sizeof(integer));
	do_uio(&c__5, posti3_ .toptit, 80L);
	do_uio(&c__1, (char *)& posti2_ .kwtype, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& posti2_ .itf, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& posti2_ .icr, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& posti2_ .idis, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& posti2_ .icow, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& posti2_ .istw, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& posti2_ .iffw, (ftnlen)sizeof(integer));
	e_rsue();

 
 


	s_rsue(&io___2872);
	do_uio(&c__1, (char *)& posti2_ .nprint, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& posti2_ .ndafi, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& ripp_ .irip, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& ripp_ .irco, (ftnlen)sizeof(integer));
	do_uio(&c__700, (char *)& ripp_ .ramp[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__700, (char *)& ripp_ .rfre[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__700, (char *)& ripp_ .rzph[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__700, (char *)& ripp_ .nrel[0], (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& ripp2_ .nrturn, (ftnlen)sizeof(integer));
	do_uio(&c__2, (char *)& skew_ .qwsk[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& skew_ .betx[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& skew_ .betz[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& skew_ .alfx[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& skew_ .alfz[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& skew_ .iskew, (ftnlen)sizeof(integer));
	do_uio(&c__6, (char *)& skew_ .nskew[0], (ftnlen)sizeof(integer));
	do_uio(&c__1, titc_ .sixtit, 80L);
	do_uio(&c__1, titc_ .commen, 80L);
	do_uio(&c__1, (char *)& tit_ .ithick, (ftnlen)sizeof(integer));
	do_uio(&c__3, (char *)& co6d_ .clo6[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__3, (char *)& co6d_ .clop6[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2100, (char *)& dkic_ .dki[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__1400, (char *)& beam_ .clobaux[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__89600, (char *)& beam_ .sigman[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__1400, (char *)& beam_ .sigman6[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__89600, (char *)& beam_ .sigman2[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__89600, (char *)& beam_ .sigmanq[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__89600, (char *)& beam_ .clobeam[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__89600, (char *)& beam_ .beamoff[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__1, (char *)& beam_ .partnum, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& beam_ .emitnx, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& beam_ .emitnz, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& beam_ .gammar, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& beam_ .nbeam, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& beam_ .nvbeam, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& beam_ .ibeco, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& beam_ .ibtyp, (ftnlen)sizeof(integer));
	do_uio(&c_b6341, (char *)& syos_ .as[0], (ftnlen)sizeof(doublereal));
	do_uio(&c_b6341, (char *)& syos_ .al[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__6, (char *)& syos_ .sigm[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__6, (char *)& syos_ .dps[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& syos_ .idz[0], (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& anf_ .dp1, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& anf_ .itra, (ftnlen)sizeof(integer));
	do_uio(&c__12, (char *)& (tra_._1) .x[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__12, (char *)& (tra_._1) .y[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& (tra_._1) .bet0[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& (tra_._1) .alf0[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& (tra_._1) .clo[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& (tra_._1) .clop[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& (chrom_._1) .cro[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& (chrom_._1) .is[0], (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& (chrom_._1) .ichrom, (ftnlen)sizeof(integer));
	do_uio(&c__20000, (char *)& xz_ .xsi[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__20000, (char *)& xz_ .zsi[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__20000, (char *)& xz_ .smi[0], (ftnlen)sizeof(doublereal));
	do_uio(&c_b6360, (char *)& xz_ .aai[0], (ftnlen)sizeof(doublereal));
	do_uio(&c_b6360, (char *)& xz_ .bbi[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__20000, (char *)& rfres_ .rsmi[0], (ftnlen)sizeof(doublereal)
		);
	do_uio(&c__20000, (char *)& rfres_ .rfres[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__20000, (char *)& rfres_ .rzphs[0], (ftnlen)sizeof(
		doublereal));
	do_uio(&c__1, (char *)& damp_ .ampt, (ftnlen)sizeof(doublereal));
	do_uio(&c__36, (char *)& tasm_ .tasm[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& dial_ .preda, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& dial_ .idial, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& dial_ .nord, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& dial_ .nvar, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& dial_ .nvar2, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& dial_ .nsix, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& dial_ .ncor, (ftnlen)sizeof(integer));
	do_uio(&c__10, (char *)& dial_ .ipar[0], (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& dial_ .idalloc, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& norf_ .nordf, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& norf_ .nvarf, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& norf_ .inorm, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& norf_ .imod1, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& norf_ .imod2, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tcorr_ .icorr, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tcorr_ .nctype, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tcorr_ .namp, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tcorr_ .nmom, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tcorr_ .nmom1, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tcorr_ .nmom2, (ftnlen)sizeof(integer));
	do_uio(&c__1, (char *)& tcorr_ .weig1, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& tcorr_ .weig2, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& tcorr_ .dpmax, (ftnlen)sizeof(doublereal));
	do_uio(&c__10, tcorrc_ .coel, 16L);
	do_uio(&c__44800, (char *)& main1_ .ekv[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__64, (char *)& main1_ .fokqv[0], (ftnlen)sizeof(doublereal));
	do_uio(&c_b6360, (char *)& main1_ .aaiv[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c_b6360, (char *)& main1_ .bbiv[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__20000, (char *)& main1_ .smiv[0], (ftnlen)sizeof(doublereal)
		);
	do_uio(&c__20000, (char *)& main1_ .zsiv[0], (ftnlen)sizeof(doublereal)
		);
	do_uio(&c__20000, (char *)& main1_ .xsiv[0], (ftnlen)sizeof(doublereal)
		);
	do_uio(&c__64, (char *)& main1_ .xsv[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main1_ .zsv[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& main1_ .qw[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__3, (char *)& main1_ .qwc[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& main1_ .clo0[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& main1_ .clop0[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& main1_ .eps[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& main1_ .epsa[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2, (char *)& main1_ .ekk[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__11, (char *)& main1_ .cr[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__11, (char *)& main1_ .ci[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__128, (char *)& main1_ .xv[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__128, (char *)& main1_ .yv[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main1_ .dam[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main1_ .ekkv[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main1_ .sigmv[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main1_ .dpsv[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main1_ .dp0v[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main1_ .sigmv6[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__64, (char *)& main1_ .dpsv6[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main1_ .ejv[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main1_ .ejfv[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main1_ .xlv[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main1_ .zlv[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main1_ .pstop[0], (ftnlen)sizeof(logical));
	do_uio(&c__64, (char *)& main1_ .rvv[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main1_ .ejf0v[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main1_ .nms[0], (ftnlen)sizeof(integer));
	do_uio(&c__64, (char *)& main1_ .nlostp[0], (ftnlen)sizeof(integer));
	do_uio(&c__64, (char *)& main2_ .dpd[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .dpsq[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .fok[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .rho[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .fok1[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .si[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .co[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .g[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .gl[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .sm1[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .sm2[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .sm3[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .sm12[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .as3[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .as4[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .as6[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .sm23[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .rhoc[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .siq[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .aek[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .afok[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .hp[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .hm[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .hc[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .hs[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .wf[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .wfa[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .wfhi[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .rhoi[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .hi[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .fi[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .hi1[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__128, (char *)& main2_ .xvl[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__128, (char *)& main2_ .yvl[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .ejvl[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .dpsvl[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main2_ .oidpsv[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__64, (char *)& main2_ .sigmvl[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__64, (char *)& main2_ .iv[0], (ftnlen)sizeof(integer));
	do_uio(&c__128, (char *)& main2_ .aperv[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__64, (char *)& main2_ .ixv[0], (ftnlen)sizeof(integer));
	do_uio(&c__128, (char *)& main2_ .clov[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__128, (char *)& main2_ .clopv[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__128, (char *)& main2_ .alf0v[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__128, (char *)& main2_ .bet0v[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__64, (char *)& main2_ .ampv[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__192, (char *)& main3_ .clo6v[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__192, (char *)& main3_ .clop6v[0], (ftnlen)sizeof(doublereal)
		);
	do_uio(&c_b6475, (char *)& main3_ .hv[0], (ftnlen)sizeof(doublereal));
	do_uio(&c_b6475, (char *)& main3_ .bl1v[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__2304, (char *)& main3_ .tas[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__192, (char *)& main3_ .qwcs[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main3_ .di0xs[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main3_ .di0zs[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__64, (char *)& main3_ .dip0xs[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__64, (char *)& main3_ .dip0zs[0], (ftnlen)sizeof(doublereal))
		;
	do_uio(&c__12, (char *)& main3_ .xau[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__6, (char *)& main3_ .cloau[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__4, (char *)& main3_ .di0au[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__36, (char *)& main3_ .tau[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__2304, (char *)& main3_ .tasau[0], (ftnlen)sizeof(doublereal)
		);
	do_uio(&c__3, (char *)& main3_ .wx[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__6, (char *)& main3_ .x1[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__6, (char *)& main3_ .x2[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__40, (char *)& main3_ .fake[0], (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& main4_ .e0f, (ftnlen)sizeof(doublereal));
	do_uio(&c__1, (char *)& main4_ .numx, (ftnlen)sizeof(integer));
	e_rsue();
 
	damp_ .damp = ((tra_._1) .amp[0] - qmodi_ .amp0) / (tra1_ .napx / 2 - 1) / 
		2;
	for (i__ = 1; i__ <= 64; ++i__) {
	    main1_ .pstop[i__ - 1] = (0) ;
	    postr2_ .nnumxv[i__ - 1] = tra1_ .numl;
 
	    main1_ .numxv[i__ - 1] = tra1_ .numl;
	}
	if (posti1_ .ipos == 1 && (posti2_ .idis != 0 || posti2_ .icow != 0 ||
		 posti2_ .istw != 0 || posti2_ .iffw != 0)) {
	    hlimit_(&c__20000);
	    hplint_(& posti2_ .kwtype);
	    if (posti2_ .itf == 3) {
		igmeta_(&c_n20, &c_n111);
	    } else {
		hplcap_(& posti2_ .itf);
	    }
	    s_copy(cpto, "NPTO", 4L, 4L);
	    if (posti2_ .icr == 1) {
		s_copy(cpto, "PTO ", 4L, 4L);
	    }
	    hplopt_(cpto, &c__1, 4L);
	    hplopt_("DATE", &c__1, 4L);
	    hplset_("DATE", &c_b2366, 4L);
	    hplset_("CSIZ", &c_b5817, 4L);
	}
    }
    rat0 = tra1_ .rat;
    i__1 = tra1_ .napx;
    for (ia = 1; ia <= i__1; ia += 2) {
	if (tra1_ .idfor != 2) {
 

	    s_wsfe(&io___2875);
	    e_wsfe();
	    bet0x2 = main3_ .tas[ia + 767] * main3_ .tas[ia + 767] + 
		    main3_ .tas[ia + 1151] * main3_ .tas[ia + 1151];
	    bet0z2 = main3_ .tas[ia + 127] * main3_ .tas[ia + 127] + 
		    main3_ .tas[ia + 511] * main3_ .tas[ia + 511];
	    bet0s1 = main3_ .tas[ia + 1791] * main3_ .tas[ia + 1791] + 
		    main3_ .tas[ia + 2175] * main3_ .tas[ia + 2175];
	    dsign = 1.;
	    tra1_ .rat = rat0;
	    if (main3_ .tas[ia + 895] < -1e-17) {
		tra1_ .rat = - tra1_ .rat;
	    }
	    if (tra1_ .rat < -1e-17) {
		dsign = -1.;
	    }
	    x11 = main2_ .ampv[ia - 1] / (sqrt(main2_ .bet0v[ia - 1]) + sqrt(
		    (( tra1_ .rat ) >= 0 ? ( tra1_ .rat ) : -( tra1_ .rat ))  * bet0x2));
	    x13 = x11 * dsign * sqrt(((( tra1_ .rat ) >= 0 ? ( tra1_ .rat ) : -( tra1_ .rat )) ));
	    (tra_._1) .amp[1] = dsign * (1 - tra1_ .iver) * ((( x11 ) >= 0 ? ( x11 ) : -( x11 ))  * sqrt(
		    bet0z2) + (( x13 ) >= 0 ? ( x13 ) : -( x13 ))  * sqrt(main2_ .bet0v[ia + 63]));
	    main3_ .x1[4] = 0.;
	    main3_ .x1[5] = main1_ .dpsv[ia - 1] * sqrt(bet0s1);
	    chi = anf_ .chi0 * kons_ .rad;
	    dchi = anf_ .chid * kons_ .rad;
	    for (i2 = 1; i2 <= 2; ++i2) {
		i3 = ia + i2 - 1;
		sic = sin(chi);
		coc = cos(chi);
		main3_ .x1[0] = x11 * coc;
		main3_ .x1[1] = x11 * sic;
		main3_ .x1[2] = x13 * coc;
		main3_ .x1[3] = x13 * sic;
		for (ii = 1; ii <= 6; ++ii) {
		    main3_ .x2[ii - 1] = 0.;
		    for (jj = 1; jj <= 6; ++jj) {
			main3_ .x2[ii - 1] += main3_ .tas[ia + (ii + jj * 6 <<
				 6) - 449] * main3_ .x1[jj - 1];
 
		    }
 
		}
		if (tra1_ .iclo6 == 1 || tra1_ .iclo6 == 2) {
		    main3_ .x2[1] /= main3_ .x2[5] + 1. + main3_ .clop6v[ia * 
			    3 - 1];
		    main3_ .x2[3] /= main3_ .x2[5] + 1. + main3_ .clop6v[ia * 
			    3 - 1];
		}
		if ((( bet0s1 ) >= 0 ? ( bet0s1 ) : -( bet0s1 ))  <= 1e-17) {
		    main3_ .x2[5] = main1_ .dpsv[ia - 1];
		}
		if (tra1_ .iver == 1) {
		    main3_ .x2[2] = 0.;
		    main3_ .x2[3] = 0.;
		}
		for (l = 1; l <= 2; ++l) {
		    ll = l - 1 << 1;
		    main1_ .xv[l + (i3 << 1) - 3] = main3_ .x2[ll] + 
			    anf_ .exz[i2 + (ll + 1 << 1) - 3];
		    main1_ .yv[l + (i3 << 1) - 3] = main3_ .x2[ll + 1] + 
			    anf_ .exz[i2 + (ll + 2 << 1) - 3];
 
		}
		main1_ .sigmv[i3 - 1] = main3_ .x2[4] + anf_ .exz[i2 + 7];
		main1_ .dpsv[i3 - 1] = main3_ .x2[5];
		dpsic = main1_ .dpsv[i3 - 1] + main3_ .clop6v[ia * 3 - 1];
		if (syn_ .idp == 1 && (( syn_ .ition ) >= 0 ? ( syn_ .ition ) : -( syn_ .ition ))  == 1 && tra1_ .iclo6 ==
			 0) {
		    main1_ .xv[(i3 << 1) - 2] += main3_ .di0xs[ia - 1] * 
			    dpsic;
		    main1_ .xv[(i3 << 1) - 1] += main3_ .di0zs[ia - 1] * 
			    dpsic;
		    main1_ .yv[(i3 << 1) - 2] += main3_ .dip0xs[ia - 1] * 
			    dpsic;
		    main1_ .yv[(i3 << 1) - 1] += main3_ .dip0zs[ia - 1] * 
			    dpsic;
		}
		chi += dchi;
 
	    }
	    s_wsfe(&io___2886);
	    do_fio(&c__1, (char *)&ia, (ftnlen)sizeof(integer));
	    i__2 = main1_ .nms[ia - 1] * rand0_ .izu0;
	    do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)& main1_ .dpsv[ia - 1], (ftnlen)sizeof(
		    doublereal));
	    e_wsfe();
	    s_wsfe(&io___2887);
	    do_fio(&c__1, (char *)& main1_ .xv[(ia << 1) - 2], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .yv[(ia << 1) - 2], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .xv[(ia << 1) - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .yv[(ia << 1) - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .sigmv[ia - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .dpsv[ia - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .xv[(ia + 1 << 1) - 2], (ftnlen)
		    sizeof(doublereal));
	    do_fio(&c__1, (char *)& main1_ .yv[(ia + 1 << 1) - 2], (ftnlen)
		    sizeof(doublereal));
	    do_fio(&c__1, (char *)& main1_ .xv[(ia + 1 << 1) - 1], (ftnlen)
		    sizeof(doublereal));
	    do_fio(&c__1, (char *)& main1_ .yv[(ia + 1 << 1) - 1], (ftnlen)
		    sizeof(doublereal));
	    do_fio(&c__1, (char *)& main1_ .sigmv[ia], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .dpsv[ia], (ftnlen)sizeof(
		    doublereal));
	    e_wsfe();
 
	    if (tra1_ .iclo6 == 2) {
		main1_ .xv[(ia << 1) - 2] += main3_ .clo6v[ia * 3 - 3];
		main1_ .yv[(ia << 1) - 2] += main3_ .clop6v[ia * 3 - 3];
		main1_ .xv[(ia << 1) - 1] += main3_ .clo6v[ia * 3 - 2];
		main1_ .yv[(ia << 1) - 1] += main3_ .clop6v[ia * 3 - 2];
		main1_ .sigmv[ia - 1] += main3_ .clo6v[ia * 3 - 1];
		main1_ .dpsv[ia - 1] += main3_ .clop6v[ia * 3 - 1];
		main1_ .xv[(ia + 1 << 1) - 2] += main3_ .clo6v[ia * 3 - 3];
		main1_ .yv[(ia + 1 << 1) - 2] += main3_ .clop6v[ia * 3 - 3];
		main1_ .xv[(ia + 1 << 1) - 1] += main3_ .clo6v[ia * 3 - 2];
		main1_ .yv[(ia + 1 << 1) - 1] += main3_ .clop6v[ia * 3 - 2];
		main1_ .sigmv[ia] += main3_ .clo6v[ia * 3 - 1];
		main1_ .dpsv[ia] += main3_ .clop6v[ia * 3 - 1];
		main2_ .oidpsv[ia - 1] = 1. / (main1_ .dpsv[ia - 1] + 1.);
		main2_ .oidpsv[ia] = 1. / (main1_ .dpsv[ia] + 1.);
	    }
	    if (tra1_ .iclo6 != 2) {
		main1_ .xv[(ia << 1) - 2] += main2_ .clov[(ia << 1) - 2] * 
			syos_ .idz[0] * (1 - tra1_ .idfor);
		main1_ .yv[(ia << 1) - 2] += main2_ .clopv[(ia << 1) - 2] * 
			syos_ .idz[0] * (1 - tra1_ .idfor);
		main1_ .xv[(ia << 1) - 1] += main2_ .clov[(ia << 1) - 1] * 
			syos_ .idz[1] * (1 - tra1_ .idfor);
		main1_ .yv[(ia << 1) - 1] += main2_ .clopv[(ia << 1) - 1] * 
			syos_ .idz[1] * (1 - tra1_ .idfor);
		main1_ .xv[(ia + 1 << 1) - 2] += main2_ .clov[(ia << 1) - 2] *
			 syos_ .idz[0] * (1 - tra1_ .idfor);
		main1_ .yv[(ia + 1 << 1) - 2] += main2_ .clopv[(ia << 1) - 2] 
			* syos_ .idz[0] * (1 - tra1_ .idfor);
		main1_ .xv[(ia + 1 << 1) - 1] += main2_ .clov[(ia << 1) - 1] *
			 syos_ .idz[1] * (1 - tra1_ .idfor);
		main1_ .yv[(ia + 1 << 1) - 1] += main2_ .clopv[(ia << 1) - 1] 
			* syos_ .idz[1] * (1 - tra1_ .idfor);
	    }
	    main1_ .ejfv[ia - 1] = main4_ .e0f * (main1_ .dpsv[ia - 1] + 1.);
	    main1_ .ejfv[ia] = main4_ .e0f * (main1_ .dpsv[ia] + 1.);
	    main1_ .ejv[ia - 1] = sqrt(main1_ .ejfv[ia - 1] * main1_ .ejfv[ia 
		    - 1] + syn_ .pma * syn_ .pma);
	    main1_ .ejv[ia] = sqrt(main1_ .ejfv[ia] * main1_ .ejfv[ia] + 
		    syn_ .pma * syn_ .pma);
	    main1_ .epsa[0] = main2_ .ampv[ia - 1] * main2_ .ampv[ia - 1] / 
		    main2_ .bet0v[ia - 1];
	    main1_ .epsa[1] = (tra_._1) .amp[1] * (tra_._1) .amp[1] / main2_ .bet0v[ia 
		    + 63];
	    s_wsfe(&io___2888);
	    do_fio(&c__1, (char *)& main2_ .ampv[ia - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& (tra_._1) .amp[1], (ftnlen)sizeof(doublereal));
	    do_fio(&c__2, (char *)& main1_ .epsa[0], (ftnlen)sizeof(doublereal)
		    );
	    e_wsfe();
	} else {
	    erro_ .ierro = s_rsle(&io___2889);
	    if (erro_ .ierro != 0) {
		goto L100102;
	    }
	    erro_ .ierro = do_lio(&c__5, &c__1, (char *)& main1_ .xv[(ia << 1) 
		    - 2], (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100102;
	    }
	    erro_ .ierro = do_lio(&c__5, &c__1, (char *)& main1_ .yv[(ia << 1) 
		    - 2], (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100102;
	    }
	    erro_ .ierro = do_lio(&c__5, &c__1, (char *)& main1_ .xv[(ia << 1) 
		    - 1], (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100102;
	    }
	    erro_ .ierro = do_lio(&c__5, &c__1, (char *)& main1_ .yv[(ia << 1) 
		    - 1], (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100102;
	    }
	    erro_ .ierro = do_lio(&c__5, &c__1, (char *)& main1_ .sigmv[ia - 1]
		    , (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100102;
	    }
	    erro_ .ierro = do_lio(&c__5, &c__1, (char *)& main1_ .dpsv[ia - 1],
		     (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100102;
	    }
	    erro_ .ierro = do_lio(&c__5, &c__1, (char *)& main1_ .xv[(ia + 1 <<
		     1) - 2], (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100102;
	    }
	    erro_ .ierro = do_lio(&c__5, &c__1, (char *)& main1_ .yv[(ia + 1 <<
		     1) - 2], (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100102;
	    }
	    erro_ .ierro = do_lio(&c__5, &c__1, (char *)& main1_ .xv[(ia + 1 <<
		     1) - 1], (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100102;
	    }
	    erro_ .ierro = do_lio(&c__5, &c__1, (char *)& main1_ .yv[(ia + 1 <<
		     1) - 1], (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100102;
	    }
	    erro_ .ierro = do_lio(&c__5, &c__1, (char *)& main1_ .sigmv[ia], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100102;
	    }
	    erro_ .ierro = do_lio(&c__5, &c__1, (char *)& main1_ .dpsv[ia], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100102;
	    }
	    erro_ .ierro = do_lio(&c__5, &c__1, (char *)& syn_ .e0, (ftnlen)
		    sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100102;
	    }
	    erro_ .ierro = do_lio(&c__5, &c__1, (char *)& main1_ .ejv[ia - 1], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100102;
	    }
	    erro_ .ierro = do_lio(&c__5, &c__1, (char *)& main1_ .ejv[ia], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100102;
	    }
	    erro_ .ierro = e_rsle();
L100102:
	    if (erro_ .ierro != 0) {
		error_(&c__56);
	    }
	    main4_ .e0f = sqrt(syn_ .e0 * syn_ .e0 - syn_ .pma * syn_ .pma);
	    main1_ .ejfv[ia - 1] = sqrt(main1_ .ejv[ia - 1] * main1_ .ejv[ia 
		    - 1] - syn_ .pma * syn_ .pma);
	    main1_ .ejfv[ia] = sqrt(main1_ .ejv[ia] * main1_ .ejv[ia] - 
		    syn_ .pma * syn_ .pma);
	    main2_ .oidpsv[ia - 1] = 1. / (main1_ .dpsv[ia - 1] + 1.);
	    main2_ .oidpsv[ia] = 1. / (main1_ .dpsv[ia] + 1.);
	}
	s_wsfe(&io___2890);
	do_fio(&c__1, (char *)& main1_ .xv[(ia << 1) - 2], (ftnlen)sizeof(
		doublereal));
	do_fio(&c__1, (char *)& main1_ .yv[(ia << 1) - 2], (ftnlen)sizeof(
		doublereal));
	do_fio(&c__1, (char *)& main1_ .xv[(ia << 1) - 1], (ftnlen)sizeof(
		doublereal));
	do_fio(&c__1, (char *)& main1_ .yv[(ia << 1) - 1], (ftnlen)sizeof(
		doublereal));
	do_fio(&c__1, (char *)& main1_ .sigmv[ia - 1], (ftnlen)sizeof(
		doublereal));
	do_fio(&c__1, (char *)& main1_ .dpsv[ia - 1], (ftnlen)sizeof(
		doublereal));
	do_fio(&c__1, (char *)& main1_ .xv[(ia + 1 << 1) - 2], (ftnlen)sizeof(
		doublereal));
	do_fio(&c__1, (char *)& main1_ .yv[(ia + 1 << 1) - 2], (ftnlen)sizeof(
		doublereal));
	do_fio(&c__1, (char *)& main1_ .xv[(ia + 1 << 1) - 1], (ftnlen)sizeof(
		doublereal));
	do_fio(&c__1, (char *)& main1_ .yv[(ia + 1 << 1) - 1], (ftnlen)sizeof(
		doublereal));
	do_fio(&c__1, (char *)& main1_ .sigmv[ia], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& main1_ .dpsv[ia], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& syn_ .e0, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& main1_ .ejv[ia - 1], (ftnlen)sizeof(doublereal)
		);
	do_fio(&c__1, (char *)& main1_ .ejv[ia], (ftnlen)sizeof(doublereal));
	e_wsfe();
	cor_ .idam = 3;
	cor_ .icode = 0;
	if ((d__1 = main1_ .xv[(ia << 1) - 2], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17 && (d__2 = 
		main1_ .yv[(ia << 1) - 2], (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) ) <= 1e-17) {
	    -- cor_ .idam;
	} else {
	    ++ cor_ .icode;
	}
	if ((d__1 = main1_ .xv[(ia << 1) - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17 && (d__2 = 
		main1_ .yv[(ia << 1) - 1], (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) ) <= 1e-17) {
	    -- cor_ .idam;
	} else {
	    cor_ .icode += 2;
	}
	if (syn_ .idp == 0 || (( syn_ .ition ) >= 0 ? ( syn_ .ition ) : -( syn_ .ition ))  == 0) {
	    -- cor_ .idam;
	} else {
	    cor_ .icode += 4;
	}
	if (cor_ .idam == 0) {
	    cor_ .idam = 1;
	}
	ia2 = (ia + 1) / 2;
	if (tra1_ .ntwin != 2) {
	    if ((ia + 1) % 2 == 0) {
		main3_ .xau[0] = main1_ .xv[(ia - 1 << 1) - 2];
		main3_ .xau[2] = main1_ .yv[(ia - 1 << 1) - 2];
		main3_ .xau[4] = main1_ .xv[(ia - 1 << 1) - 1];
		main3_ .xau[6] = main1_ .yv[(ia - 1 << 1) - 1];
		main3_ .xau[8] = main1_ .sigmv[ia - 2];
		main3_ .xau[10] = main1_ .dpsv[ia - 2];
		main3_ .xau[1] = main1_ .xv[(ia << 1) - 2];
		main3_ .xau[3] = main1_ .yv[(ia << 1) - 2];
		main3_ .xau[5] = main1_ .xv[(ia << 1) - 1];
		main3_ .xau[7] = main1_ .yv[(ia << 1) - 1];
		main3_ .xau[9] = main1_ .sigmv[ia - 1];
		main3_ .xau[11] = main1_ .dpsv[ia - 1];
		main3_ .cloau[0] = main3_ .clo6v[ia * 3 - 3];
		main3_ .cloau[1] = main3_ .clop6v[ia * 3 - 3];
		main3_ .cloau[2] = main3_ .clo6v[ia * 3 - 2];
		main3_ .cloau[3] = main3_ .clop6v[ia * 3 - 2];
		main3_ .cloau[4] = main3_ .clo6v[ia * 3 - 1];
		main3_ .cloau[5] = main3_ .clop6v[ia * 3 - 1];
		main3_ .di0au[0] = main3_ .di0xs[ia - 1];
		main3_ .di0au[1] = main3_ .dip0xs[ia - 1];
		main3_ .di0au[2] = main3_ .di0zs[ia - 1];
		main3_ .di0au[3] = main3_ .dip0zs[ia - 1];
		for (ib2 = 1; ib2 <= 6; ++ib2) {
		    for (ib3 = 1; ib3 <= 6; ++ib3) {
			main3_ .tau[ib2 + ib3 * 6 - 7] = main3_ .tasau[ia + (
				ib2 + ib3 * 6 << 6) - 449];
 
		    }
		}
		distance_(main3_ .xau, main3_ .cloau, main3_ .di0au, 
			main3_ .tau, &dam1);
		main1_ .dam[ia - 1] = dam1;
		main1_ .dam[ia - 2] = dam1;
	    }
	    io___2893.ciunit = 91 - ia2;
	    erro_ .ierro = s_wsue(&io___2893);
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, titc_ .sixtit, 80L);
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, titc_ .commen, 80L);
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, cdate, 8L);
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, ctime, 8L);
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, progrm, 8L);
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&ia, (ftnlen)sizeof(integer))
		    ;
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&ia, (ftnlen)sizeof(integer))
		    ;
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& tra1_ .napx, (ftnlen)sizeof(
		    integer));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& cor_ .icode, (ftnlen)sizeof(
		    integer));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& tra1_ .numl, (ftnlen)sizeof(
		    integer));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .qwcs[ia - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .qwcs[ia + 63], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .qwcs[ia + 127], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .clo6v[ia * 3 - 3], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .clop6v[ia * 3 - 3], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .clo6v[ia * 3 - 2], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .clop6v[ia * 3 - 2], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .clo6v[ia * 3 - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .clop6v[ia * 3 - 1], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .di0xs[ia - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .dip0xs[ia - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .di0zs[ia - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .dip0zs[ia - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b2366, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 383], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 767], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1151], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1535], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1919], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 63], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 447], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 831], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1215], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1599], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1983], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 127], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 511], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 895], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1279], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1663], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 2047], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 191], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 575], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 959], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1343], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1727], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 2111], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 255], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 639], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1023], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1407], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1791], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 2175], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 319], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 703], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1087], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1471], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1855], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 2239], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    d__1 = (doublereal) rand0_ .mmac;
	    erro_ .ierro = do_uio(&c__1, (char *)&d__1, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    d__2 = (doublereal) main1_ .nms[ia - 1];
	    erro_ .ierro = do_uio(&c__1, (char *)&d__2, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    d__3 = (doublereal) rand0_ .izu0;
	    erro_ .ierro = do_uio(&c__1, (char *)&d__3, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    d__4 = (doublereal) tra1_ .numlr;
	    erro_ .ierro = do_uio(&c__1, (char *)&d__4, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& cor_ .sigcor, (ftnlen)
		    sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& cor_ .dpscor, (ftnlen)
		    sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    d__5 = (doublereal) ripp2_ .nrturn;
	    erro_ .ierro = do_uio(&c__1, (char *)&d__5, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100103;
	    }
	    erro_ .ierro = e_wsue();
L100103:
	    ;
	} else {
	    io___2896.ciunit = 91 - ia2;
	    erro_ .ierro = s_wsue(&io___2896);
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, titc_ .sixtit, 80L);
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, titc_ .commen, 80L);
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, cdate, 8L);
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, ctime, 8L);
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, progrm, 8L);
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&ia, (ftnlen)sizeof(integer))
		    ;
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    i__2 = ia + 1;
	    erro_ .ierro = do_uio(&c__1, (char *)&i__2, (ftnlen)sizeof(
		    integer));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& tra1_ .napx, (ftnlen)sizeof(
		    integer));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& cor_ .icode, (ftnlen)sizeof(
		    integer));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& tra1_ .numl, (ftnlen)sizeof(
		    integer));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .qwcs[ia - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .qwcs[ia + 63], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .qwcs[ia + 127], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .clo6v[ia * 3 - 3], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .clop6v[ia * 3 - 3], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .clo6v[ia * 3 - 2], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .clop6v[ia * 3 - 2], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .clo6v[ia * 3 - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .clop6v[ia * 3 - 1], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .di0xs[ia - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .dip0xs[ia - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .di0zs[ia - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .dip0zs[ia - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b2366, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 383], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 767], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1151], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1535], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1919], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 63], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 447], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 831], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1215], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1599], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1983], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 127], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 511], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 895], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1279], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1663], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 2047], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 191], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 575], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 959], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1343], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1727], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 2111], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 255], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 639], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1023], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1407], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1791], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 2175], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 319], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 703], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1087], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1471], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 1855], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& main3_ .tas[ia + 2239], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    d__1 = (doublereal) rand0_ .mmac;
	    erro_ .ierro = do_uio(&c__1, (char *)&d__1, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    d__2 = (doublereal) main1_ .nms[ia - 1];
	    erro_ .ierro = do_uio(&c__1, (char *)&d__2, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    d__3 = (doublereal) rand0_ .izu0;
	    erro_ .ierro = do_uio(&c__1, (char *)&d__3, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    d__4 = (doublereal) tra1_ .numlr;
	    erro_ .ierro = do_uio(&c__1, (char *)&d__4, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& cor_ .sigcor, (ftnlen)
		    sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)& cor_ .dpscor, (ftnlen)
		    sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    d__5 = (doublereal) ripp2_ .nrturn;
	    erro_ .ierro = do_uio(&c__1, (char *)&d__5, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = do_uio(&c__1, (char *)&c_b251, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100104;
	    }
	    erro_ .ierro = e_wsue();
L100104:
	    ;
	}
	if (erro_ .ierro != 0) {
	    s_wsle(&io___2897);
	    e_wsle();
	    s_wsle(&io___2898);
	    do_lio(&c__9, &c__1, "*** ERROR ***,PROBLEMS WRITTING TO FILE # : ", 44L);
	    i__2 = 91 - ia2;
	    do_lio(&c__3, &c__1, (char *)&i__2, (ftnlen)sizeof(integer));
	    e_wsle();
	    s_wsle(&io___2899);
	    do_lio(&c__9, &c__1, "ERROR CODE : ", 13L);
	    do_lio(&c__3, &c__1, (char *)& erro_ .ierro, (ftnlen)sizeof(
		    integer));
	    e_wsle();
	    s_wsle(&io___2900);
	    e_wsle();
	    goto L520;
	}
 
    }
    if (syn_ .e0 > 1e-17) {
	i__1 = tra1_ .napx;
	for (j = 1; j <= i__1; ++j) {
 
	    main1_ .rvv[j - 1] = main1_ .ejv[j - 1] / syn_ .e0 * main4_ .e0f /
		     main1_ .ejfv[j - 1];
	}
    } else {
	error_(&c__79);
    }
    if (tit_ .ithick == 1) {
	envarsv_(main1_ .dpsv, main2_ .oidpsv, main1_ .rvv, main1_ .ekv);
    }
 
    i__1 = str_ .mblo;
    for (k = 1; k <= i__1; ++k) {
	jm = str2_ .mel[k - 1];
	ikk = str2_ .mtyp[k - 1];
	for (lkk = 1; lkk <= 2; ++lkk) {
	    for (mkk = 1; mkk <= 6; ++mkk) {
		i__2 = tra1_ .napx;
		for (ia = 1; ia <= i__2; ++ia) {
		    dpoff = main1_ .dpsv[ia - 1] * 1e3;
		    if ((( dpoff ) >= 0 ? ( dpoff ) : -( dpoff ))  <= 1e-17) {
			dpoff = 1.;
		    }
		    main3_ .hv[mkk + (lkk + (ia + 64 << 1)) * 6 - 787] = 
			    syos_ .al[mkk + (lkk + (ia + (ikk << 6) << 1)) * 
			    6 - 787];
 
		    if (mkk == 5 || mkk == 6) {
			main3_ .hv[mkk + (lkk + (ia + 64 << 1)) * 6 - 787] /= 
				dpoff;
		    }
		}
 
	    }
	}
	if (jm == 1) {
	    goto L410;
	}
	i__2 = jm;
	for (j = 2; j <= i__2; ++j) {
	    ikk = str2_ .mtyp[k + j * 300 - 301];
	    for (lkk = 1; lkk <= 2; ++lkk) {
		i__3 = tra1_ .napx;
		for (ia = 1; ia <= i__3; ++ia) {
		    dpoff = main1_ .dpsv[ia - 1] * 1e3;
		    if ((( dpoff ) >= 0 ? ( dpoff ) : -( dpoff ))  <= 1e-17) {
			dpoff = 1.;
		    }
		    main3_ .hv[(lkk + (ia + (j << 6) << 1)) * 6 - 786] = 
			    main3_ .hv[(lkk + (ia + (j - 1 << 6) << 1)) * 6 - 
			    786] * syos_ .al[(lkk + (ia + (ikk << 6) << 1)) * 
			    6 - 786] + main3_ .hv[(lkk + (ia + (j - 1 << 6) <<
			     1)) * 6 - 784] * syos_ .al[(lkk + (ia + (ikk << 
			    6) << 1)) * 6 - 785];
		    main3_ .hv[(lkk + (ia + (j << 6) << 1)) * 6 - 785] = 
			    main3_ .hv[(lkk + (ia + (j - 1 << 6) << 1)) * 6 - 
			    785] * syos_ .al[(lkk + (ia + (ikk << 6) << 1)) * 
			    6 - 786] + main3_ .hv[(lkk + (ia + (j - 1 << 6) <<
			     1)) * 6 - 783] * syos_ .al[(lkk + (ia + (ikk << 
			    6) << 1)) * 6 - 785];
		    main3_ .hv[(lkk + (ia + (j << 6) << 1)) * 6 - 784] = 
			    main3_ .hv[(lkk + (ia + (j - 1 << 6) << 1)) * 6 - 
			    786] * syos_ .al[(lkk + (ia + (ikk << 6) << 1)) * 
			    6 - 784] + main3_ .hv[(lkk + (ia + (j - 1 << 6) <<
			     1)) * 6 - 784] * syos_ .al[(lkk + (ia + (ikk << 
			    6) << 1)) * 6 - 783];
		    main3_ .hv[(lkk + (ia + (j << 6) << 1)) * 6 - 783] = 
			    main3_ .hv[(lkk + (ia + (j - 1 << 6) << 1)) * 6 - 
			    785] * syos_ .al[(lkk + (ia + (ikk << 6) << 1)) * 
			    6 - 784] + main3_ .hv[(lkk + (ia + (j - 1 << 6) <<
			     1)) * 6 - 783] * syos_ .al[(lkk + (ia + (ikk << 
			    6) << 1)) * 6 - 783];
		    main3_ .hv[(lkk + (ia + (j << 6) << 1)) * 6 - 782] = 
			    main3_ .hv[(lkk + (ia + (j - 1 << 6) << 1)) * 6 - 
			    782] * syos_ .al[(lkk + (ia + (ikk << 6) << 1)) * 
			    6 - 786] + main3_ .hv[(lkk + (ia + (j - 1 << 6) <<
			     1)) * 6 - 781] * syos_ .al[(lkk + (ia + (ikk << 
			    6) << 1)) * 6 - 785] + syos_ .al[(lkk + (ia + (
			    ikk << 6) << 1)) * 6 - 782] / dpoff;
		    main3_ .hv[(lkk + (ia + (j << 6) << 1)) * 6 - 781] = 
			    main3_ .hv[(lkk + (ia + (j - 1 << 6) << 1)) * 6 - 
			    782] * syos_ .al[(lkk + (ia + (ikk << 6) << 1)) * 
			    6 - 784] + main3_ .hv[(lkk + (ia + (j - 1 << 6) <<
			     1)) * 6 - 781] * syos_ .al[(lkk + (ia + (ikk << 
			    6) << 1)) * 6 - 783] + syos_ .al[(lkk + (ia + (
			    ikk << 6) << 1)) * 6 - 781] / dpoff;
 
		}
 
	    }
 
	}
L410:
	for (lkk = 1; lkk <= 2; ++lkk) {
	    for (mkk = 1; mkk <= 6; ++mkk) {
		i__2 = tra1_ .napx;
		for (ia = 1; ia <= i__2; ++ia) {
 
		    main3_ .bl1v[mkk + (lkk + (ia + (k << 6) << 1)) * 6 - 787]
			     = main3_ .hv[mkk + (lkk + (ia + (jm << 6) << 1)) 
			    * 6 - 787];
		}
 
	    }
	}
 
    }
 
    s_wsfe(&io___2906);
    e_wsfe();
 

    if (tit_ .ithick == 0) {
	trauthin_(&nthinerr);
    }
    if (tit_ .ithick == 1) {
	trauthck_(&nthinerr);
    }
    if (nthinerr == 3000) {
	goto L520;
    }
    if (nthinerr == 3001) {
	goto L460;
    }
 
L460:
    napxto = 0;
    id = 0;
    ++ main4_ .numx;
    writebin_(&nthinerr);
    if (nthinerr == 3000) {
	goto L520;
    }
    i__1 = tra1_ .napxo;
    for (ia = 1; ia <= i__1; ia += 2) {
	ie = ia + 1;
	ia2 = ie / 2;
	napxto = napxto + main1_ .numxv[ia - 1] + main1_ .numxv[ie - 1];
	if (main1_ .pstop[ia - 1] && main1_ .pstop[ie - 1]) {
 
	    s_wsfe(&io___2911);
	    do_fio(&c__1, (char *)&ia, (ftnlen)sizeof(integer));
	    i__2 = main1_ .nms[ia - 1] * rand0_ .izu0;
	    do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)& main1_ .dp0v[ia - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .numxv[ia - 1], (ftnlen)sizeof(
		    integer));
	    d__2 = (d__1 = main2_ .xvl[(ia << 1) - 2], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
	    do_fio(&c__1, (char *)&d__2, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& main2_ .aperv[ia - 1], (ftnlen)sizeof(
		    doublereal));
	    d__4 = (d__3 = main2_ .xvl[(ia << 1) - 1], (( d__3 ) >= 0 ? ( d__3 ) : -( d__3 )) );
	    do_fio(&c__1, (char *)&d__4, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& main2_ .aperv[ia + 63], (ftnlen)sizeof(
		    doublereal));
	    e_wsfe();
	    s_wsfe(&io___2912);
	    do_fio(&c__1, (char *)&ie, (ftnlen)sizeof(integer));
	    i__2 = main1_ .nms[ia - 1] * rand0_ .izu0;
	    do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)& main1_ .dp0v[ia - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .numxv[ie - 1], (ftnlen)sizeof(
		    integer));
	    d__2 = (d__1 = main2_ .xvl[(ie << 1) - 2], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
	    do_fio(&c__1, (char *)&d__2, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& main2_ .aperv[ie - 1], (ftnlen)sizeof(
		    doublereal));
	    d__4 = (d__3 = main2_ .xvl[(ie << 1) - 1], (( d__3 ) >= 0 ? ( d__3 ) : -( d__3 )) );
	    do_fio(&c__1, (char *)&d__4, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& main2_ .aperv[ie + 63], (ftnlen)sizeof(
		    doublereal));
	    e_wsfe();
	    s_wsfe(&io___2913);
	    do_fio(&c__1, (char *)& main2_ .xvl[(ia << 1) - 2], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main2_ .yvl[(ia << 1) - 2], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main2_ .xvl[(ia << 1) - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main2_ .yvl[(ia << 1) - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main2_ .sigmvl[ia - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main2_ .dpsvl[ia - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main2_ .xvl[(ie << 1) - 2], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main2_ .yvl[(ie << 1) - 2], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main2_ .xvl[(ie << 1) - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main2_ .yvl[(ie << 1) - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main2_ .sigmvl[ie - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main2_ .dpsvl[ie - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& syn_ .e0, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& main2_ .ejvl[ia - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main2_ .ejvl[ie - 1], (ftnlen)sizeof(
		    doublereal));
	    e_wsfe();
	    erro_ .ierro = s_wsfe(&io___2914);
	    if (erro_ .ierro != 0) {
		goto L100105;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .xvl[(ia << 1) - 2], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100105;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .yvl[(ia << 1) - 2], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100105;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .xvl[(ia << 1) - 1], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100105;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .yvl[(ia << 1) - 1], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100105;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .sigmvl[ia - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100105;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .dpsvl[ia - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100105;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .xvl[(ie << 1) - 2], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100105;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .yvl[(ie << 1) - 2], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100105;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .xvl[(ie << 1) - 1], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100105;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .yvl[(ie << 1) - 1], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100105;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .sigmvl[ie - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100105;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .dpsvl[ie - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100105;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& syn_ .e0, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100105;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .ejvl[ia - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100105;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .ejvl[ie - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100105;
	    }
	    erro_ .ierro = e_wsfe();
L100105:
	    if (erro_ .ierro != 0) {
		s_wsle(&io___2915);
		do_lio(&c__9, &c__1, "Warning from maincr: fort.12 has ", 33L)
			;
		do_lio(&c__9, &c__1, "corrupted output probably due to lost particle: ", 48L);
		do_lio(&c__3, &c__1, (char *)&ia, (ftnlen)sizeof(integer));
		do_lio(&c__9, &c__1, " or: ", 5L);
		do_lio(&c__3, &c__1, (char *)&ie, (ftnlen)sizeof(integer));
		e_wsle();
	    }
	}
	if (! main1_ .pstop[ia - 1] && main1_ .pstop[ie - 1]) {
 
	    ++id;
	    s_wsfe(&io___2916);
	    do_fio(&c__1, (char *)&ia, (ftnlen)sizeof(integer));
	    i__2 = main1_ .nms[ia - 1] * rand0_ .izu0;
	    do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)& main1_ .dp0v[ia - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .numxv[ia - 1], (ftnlen)sizeof(
		    integer));
	    e_wsfe();
	    s_wsfe(&io___2917);
	    do_fio(&c__1, (char *)&ie, (ftnlen)sizeof(integer));
	    i__2 = main1_ .nms[ia - 1] * rand0_ .izu0;
	    do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)& main1_ .dp0v[ia - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .numxv[ie - 1], (ftnlen)sizeof(
		    integer));
	    d__2 = (d__1 = main2_ .xvl[(ie << 1) - 2], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
	    do_fio(&c__1, (char *)&d__2, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& main2_ .aperv[ie - 1], (ftnlen)sizeof(
		    doublereal));
	    d__4 = (d__3 = main2_ .xvl[(ie << 1) - 1], (( d__3 ) >= 0 ? ( d__3 ) : -( d__3 )) );
	    do_fio(&c__1, (char *)&d__4, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& main2_ .aperv[ie + 63], (ftnlen)sizeof(
		    doublereal));
	    e_wsfe();
	    s_wsfe(&io___2918);
	    do_fio(&c__1, (char *)& main1_ .xv[(id << 1) - 2], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .yv[(id << 1) - 2], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .xv[(id << 1) - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .yv[(id << 1) - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .sigmv[id - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .dpsv[id - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main2_ .xvl[(ie << 1) - 2], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main2_ .yvl[(ie << 1) - 2], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main2_ .xvl[(ie << 1) - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main2_ .yvl[(ie << 1) - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main2_ .sigmvl[ie - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main2_ .dpsvl[ie - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& syn_ .e0, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& main1_ .ejv[id - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main2_ .ejvl[ie - 1], (ftnlen)sizeof(
		    doublereal));
	    e_wsfe();
	    erro_ .ierro = s_wsfe(&io___2919);
	    if (erro_ .ierro != 0) {
		goto L100106;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .xv[(id << 1) - 2], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100106;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .yv[(id << 1) - 2], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100106;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .xv[(id << 1) - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100106;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .yv[(id << 1) - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100106;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .sigmv[id - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100106;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .dpsv[id - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100106;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .xvl[(ie << 1) - 2], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100106;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .yvl[(ie << 1) - 2], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100106;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .xvl[(ie << 1) - 1], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100106;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .yvl[(ie << 1) - 1], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100106;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .sigmvl[ie - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100106;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .dpsvl[ie - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100106;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& syn_ .e0, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100106;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .ejv[id - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100106;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .ejvl[ie - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100106;
	    }
	    erro_ .ierro = e_wsfe();
L100106:
	    if (erro_ .ierro != 0) {
		s_wsle(&io___2920);
		do_lio(&c__9, &c__1, "Warning from maincr: fort.12 has ", 33L)
			;
		do_lio(&c__9, &c__1, "corrupted output probably due to lost particle: ", 48L);
		do_lio(&c__3, &c__1, (char *)&ie, (ftnlen)sizeof(integer));
		e_wsle();
	    }
	}
	if (main1_ .pstop[ia - 1] && ! main1_ .pstop[ie - 1]) {
 
	    ++id;
	    s_wsfe(&io___2921);
	    do_fio(&c__1, (char *)&ia, (ftnlen)sizeof(integer));
	    i__2 = main1_ .nms[ia - 1] * rand0_ .izu0;
	    do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)& main1_ .dp0v[ia - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .numxv[ia - 1], (ftnlen)sizeof(
		    integer));
	    d__2 = (d__1 = main2_ .xvl[(ia << 1) - 2], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
	    do_fio(&c__1, (char *)&d__2, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& main2_ .aperv[ia - 1], (ftnlen)sizeof(
		    doublereal));
	    d__4 = (d__3 = main2_ .xvl[(ia << 1) - 1], (( d__3 ) >= 0 ? ( d__3 ) : -( d__3 )) );
	    do_fio(&c__1, (char *)&d__4, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& main2_ .aperv[ia + 63], (ftnlen)sizeof(
		    doublereal));
	    e_wsfe();
	    s_wsfe(&io___2922);
	    do_fio(&c__1, (char *)&ie, (ftnlen)sizeof(integer));
	    i__2 = main1_ .nms[ia - 1] * rand0_ .izu0;
	    do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)& main1_ .dp0v[ia - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .numxv[ie - 1], (ftnlen)sizeof(
		    integer));
	    e_wsfe();
	    s_wsfe(&io___2923);
	    do_fio(&c__1, (char *)& main2_ .xvl[(ia << 1) - 2], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main2_ .yvl[(ia << 1) - 2], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main2_ .xvl[(ia << 1) - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main2_ .yvl[(ia << 1) - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main2_ .sigmvl[ia - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main2_ .dpsvl[ia - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .xv[(id << 1) - 2], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .yv[(id << 1) - 2], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .xv[(id << 1) - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .yv[(id << 1) - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .sigmv[id - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .dpsv[id - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& syn_ .e0, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& main2_ .ejvl[ia - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .ejv[id - 1], (ftnlen)sizeof(
		    doublereal));
	    e_wsfe();
	    erro_ .ierro = s_wsfe(&io___2924);
	    if (erro_ .ierro != 0) {
		goto L100107;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .xvl[(ia << 1) - 2], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100107;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .yvl[(ia << 1) - 2], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100107;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .xvl[(ia << 1) - 1], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100107;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .yvl[(ia << 1) - 1], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100107;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .sigmvl[ia - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100107;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .dpsvl[ia - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100107;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .xv[(id << 1) - 2], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100107;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .yv[(id << 1) - 2], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100107;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .xv[(id << 1) - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100107;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .yv[(id << 1) - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100107;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .sigmv[id - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100107;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .dpsv[id - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100107;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& syn_ .e0, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100107;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .ejvl[ia - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100107;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .ejv[id - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100107;
	    }
	    erro_ .ierro = e_wsfe();
L100107:
	    if (erro_ .ierro != 0) {
		s_wsle(&io___2925);
		do_lio(&c__9, &c__1, "Warning from maincr: fort.12 has ", 33L)
			;
		do_lio(&c__9, &c__1, "corrupted output probably due to lost particle: ", 48L);
		do_lio(&c__3, &c__1, (char *)&ia, (ftnlen)sizeof(integer));
		e_wsle();
	    }
	}
	if (! main1_ .pstop[ia - 1] && ! main1_ .pstop[ie - 1]) {
 
	    ++id;
	    ig = id + 1;
	    s_wsfe(&io___2927);
	    do_fio(&c__1, (char *)&ia, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&ie, (ftnlen)sizeof(integer));
	    i__2 = main1_ .nms[ia - 1] * rand0_ .izu0;
	    do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)& main1_ .dp0v[ia - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .numxv[ia - 1], (ftnlen)sizeof(
		    integer));
	    e_wsfe();
	    s_wsfe(&io___2928);
	    do_fio(&c__1, (char *)& main1_ .xv[(id << 1) - 2], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .yv[(id << 1) - 2], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .xv[(id << 1) - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .yv[(id << 1) - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .sigmv[id - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .dpsv[id - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .xv[(ig << 1) - 2], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .yv[(ig << 1) - 2], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .xv[(ig << 1) - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .yv[(ig << 1) - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .sigmv[ig - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .dpsv[ig - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& syn_ .e0, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& main1_ .ejv[id - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .ejv[ig - 1], (ftnlen)sizeof(
		    doublereal));
	    e_wsfe();
	    erro_ .ierro = s_wsfe(&io___2929);
	    if (erro_ .ierro != 0) {
		goto L100108;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .xv[(id << 1) - 2], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100108;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .yv[(id << 1) - 2], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100108;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .xv[(id << 1) - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100108;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .yv[(id << 1) - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100108;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .sigmv[id - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100108;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .dpsv[id - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100108;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .xv[(ig << 1) - 2], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100108;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .yv[(ig << 1) - 2], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100108;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .xv[(ig << 1) - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100108;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .yv[(ig << 1) - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100108;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .sigmv[ig - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100108;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .dpsv[ig - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100108;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& syn_ .e0, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100108;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .ejv[id - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100108;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .ejv[ig - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100108;
	    }
	    erro_ .ierro = e_wsfe();
L100108:
	    if (erro_ .ierro != 0) {
		s_wsle(&io___2930);
		do_lio(&c__9, &c__1, "Warning from maincr: fort.12 has ", 33L)
			;
		do_lio(&c__9, &c__1, "corrupted output although particles stable", 42L);
		e_wsle();
	    }
	    id = ig;
	}
 
    }
    iposc = 0;
    if (posti1_ .ipos == 1) {
	i__1 = tra1_ .napxo;
	for (ia = 1; ia <= i__1; ia += 2) {
	    ia2 = (ia + 1) / 2;
	    ++iposc;
	    i__2 = 91 - ia2;
	    postpr_(&i__2);
 
	}
	if (iposc >= 1) {
	    sumpos_();
	}
    }
    goto L520;
L490:
    if (posti1_ .ipos == 1) {
	ndafi2 = posti2_ .ndafi;
	i__1 = ndafi2;
	for (ia = 1; ia <= i__1; ++ia) {
	    if (ia > posti2_ .ndafi) {
		goto L510;
	    }
	    i__2 = 91 - ia;
	    postpr_(&i__2);
	    cl__1.cerr = 0;
	    cl__1.cunit = 91 - ia;
	    cl__1.csta = 0;
	    f_clos(&cl__1);
 
	}
L510:
	if (posti2_ .ndafi >= 1) {
	    sumpos_();
	}
    }
L520:
 
    if (posti1_ .ipos == 1 && (posti2_ .idis != 0 || posti2_ .icow != 0 || 
	    posti2_ .istw != 0 || posti2_ .iffw != 0)) {
	hplend_();
    }
    s_wsfe(&io___2933);
    do_fio(&c__1, (char *)&napxto, (ftnlen)sizeof(integer));
    e_wsfe();
 

    s_stop("", 0L);
 
 
 
 
 
}  

 
  int mainia6_(iqmod6, eps, cor6d)
integer *iqmod6;
doublereal *eps, *cor6d;
{
     
    integer i__1;
    doublereal d__1, d__2;
    alist al__1;

     
    double atan();
    integer f_rew(), s_wsle(), do_lio(), e_wsle();

     
    extern   int rotatio6_();
    static integer i__, j[12], jj[8];
    static doublereal fac, coe, tas, det1, x2pi;
    static integer iham, nord;
    extern   int ambm6_(), dadal_(), darea_(), daall_(), 
	    dacct_(), dader_(), dapek_(), dacop_(), dacmu_(), datra_();
    static integer mfile;
    extern   int davar_(), dapok_(), error_();
    static integer itype;
    static doublereal coefh1, coefh2, coefv1;
    extern   int creat6_();
    static doublereal coefv2;
    extern   int gofix6_();
    static integer infile__;
    static doublereal outfil;
    extern   int dacond6_(), dacopd6_(), midbloc6_(), 
	    ctrbasi6_(), orderma6_();

     
    static cilist io___2944 = { 0, 6, 0, 0, 0 };
    static cilist io___2945 = { 0, 6, 0, 0, 0 };


 
 
 
 




     
    cor6d -= 3;

     
    daall_(& nom_ .bb1, &c__1, "BB1       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(& nom_ .bb2, &c__1, "BB2       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(nom_ .rot, &c__12, "ROT       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(nom_ .roti, &c__12, "ROTI      ", & ii_ .no, & ii_ .nv, 10L);
    daall_(nom_ .rel, &c__12, "REL       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(& super_ .fs, &c__1, "FS        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(nom_ .ctr, &c__12, "CTR       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(nom_ .cjg, &c__12, "CJG       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(nom_ .rtc, &c__12, "RTC       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(vecteur_ .a2, &c__12, "A2        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(vecteur_ .a2i, &c__12, "A2I       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(vecteur_ .cm, &c__12, "CM        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(vecteur_ .a1, &c__12, "A1        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(vecteur_ .v, &c__12, "V         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(vecteur_ .w, &c__12, "W         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(vecteur_ .x, &c__12, "X         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(vecteur_ .xy, &c__12, "XY        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(& vecteur_ .h__, &c__1, "H         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(& vecteur_ .ft, &c__1, "FT        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(vecteur_ .a1i, &c__12, "A1I       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(& super_ .hs, &c__1, "HS        ", & ii_ .no, & ii_ .nv, 10L);
 
    x2pi = atan(1.) * 8.;
    infile__ = 18;
    outfil = 19.;
    al__1.aerr = 0;
    al__1.aunit = infile__;
    f_rew(&al__1);
    nord = 1;
    fac = 1.;
    stable_ .sta[0] = 1.;
    stable_ .sta[1] = 1.;
    stable_ .sta[2] = 1.;
    iham = 0;
    for (i__ = 1; i__ <= 3; ++i__) {
 
	stable_ .dsta[i__ - 1] = 1. - stable_ .sta[i__ - 1];
    }
    for (i__ = 1; i__ <= 3; ++i__) {
	istable_ .ista[i__ - 1] = (integer) (stable_ .sta[i__ - 1] + (float)
		.01);
 
	istable_ .idsta[i__ - 1] = (integer) (stable_ .dsta[i__ - 1] + (float)
		.01);
    }
    creat6_();
    dacond6_(vecteur_ .xy, &c_b251);
    i__1 = ii_ .nv;
    for (i__ = 7; i__ <= i__1; ++i__) {
 
	davar_(& vecteur_ .xy[i__ - 1], &c_b251, &i__);
    }
    mfile = infile__;
    for (i__ = 1; i__ <= 6; ++i__) {
	darea_(& vecteur_ .xy[i__ - 1], &mfile);
 
	dapok_(& vecteur_ .xy[i__ - 1], j, &c_b251);
    }
 
    itype = 3;
    mfile = (integer) outfil;
    gofix6_(vecteur_ .xy, vecteur_ .x, vecteur_ .v, vecteur_ .w, nom_ .rel, 
	    vecteur_ .a1, vecteur_ .a1i, &nord);
    midbloc6_(vecteur_ .x, vecteur_ .a2, vecteur_ .a2i, tune_ .angle);
    if (1. - tune_ .angle[2] / x2pi > (float).5) {
	s_wsle(&io___2944);
	for (i__ = 1; i__ <= 2; ++i__) {
	    d__1 = tune_ .angle[i__ - 1] / x2pi;
	    do_lio(&c__5, &c__1, (char *)&d__1, (ftnlen)sizeof(doublereal));
	}
	d__2 = tune_ .angle[2] / x2pi;
	do_lio(&c__5, &c__1, (char *)&d__2, (ftnlen)sizeof(doublereal));
	e_wsle();
    } else {
	s_wsle(&io___2945);
	for (i__ = 1; i__ <= 2; ++i__) {
	    d__1 = tune_ .angle[i__ - 1] / x2pi;
	    do_lio(&c__5, &c__1, (char *)&d__1, (ftnlen)sizeof(doublereal));
	}
	d__2 = 1. - tune_ .angle[2] / x2pi;
	do_lio(&c__5, &c__1, (char *)&d__2, (ftnlen)sizeof(doublereal));
	e_wsle();
    }
    ambm6_(& ii_ .no, &iham);
    rotatio6_();
    dacopd6_(vecteur_ .a2i, vecteur_ .v);
    dacct_(vecteur_ .v, &c__6, vecteur_ .x, & ii_ .nv, vecteur_ .w, &c__6);
    dacct_(vecteur_ .w, &c__6, vecteur_ .a2, & ii_ .nv, vecteur_ .v, &c__6);
    dacct_(vecteur_ .v, &c__6, nom_ .roti, & ii_ .nv, vecteur_ .x, &c__6);
    orderma6_(& vecteur_ .h__, & vecteur_ .ft, vecteur_ .x, vecteur_ .v, 
	    vecteur_ .w, nom_ .rel, nom_ .cjg, nom_ .ctr, nom_ .rtc, 
	    nom_ .roti);
 
 
 
    for (i__ = 1; i__ <= 3; ++i__) {
 
	tune_ .angle[i__ - 1] *= fac;
    }
    rotatio6_();
 
    dacmu_(& vecteur_ .h__, &fac, & nom_ .bb2);
    dacop_(& nom_ .bb2, & vecteur_ .h__);
 
 
 
 
    for (i__ = 1; i__ <= 6; ++i__) {
	jj[i__ - 1] = 1;
	dapek_(vecteur_ .a2, jj, &tas);
	tasm_ .tasm[i__ * 6 - 6] = tas;
	dapek_(& vecteur_ .a2[1], jj, &tas);
	tasm_ .tasm[i__ * 6 - 5] = tas;
	dapek_(& vecteur_ .a2[2], jj, &tas);
	tasm_ .tasm[i__ * 6 - 4] = tas;
	dapek_(& vecteur_ .a2[3], jj, &tas);
	tasm_ .tasm[i__ * 6 - 3] = tas;
	dapek_(& vecteur_ .a2[4], jj, &tas);
	tasm_ .tasm[i__ * 6 - 2] = tas;
	dapek_(& vecteur_ .a2[5], jj, &tas);
	tasm_ .tasm[i__ * 6 - 1] = tas;
	jj[i__ - 1] = 0;
 
    }
    for (i__ = 1; i__ <= 5; ++i__) {
	tasm_ .tasm[i__ * 6 - 1] *= .001;
	tasm_ .tasm[i__ + 29] *= 1e3;
 
    }
    if (*iqmod6 == 1) {
	dacond6_(vecteur_ .x, &c_b251);
	coe = -2. / x2pi;
	ctrbasi6_(& vecteur_ .h__, & super_ .hs, nom_ .ctr, nom_ .cjg);
	for (i__ = 1; i__ <= 3; ++i__) {
	    i__1 = (i__ << 1) - 1;
	    dader_(&i__1, & vecteur_ .h__, & nom_ .bb1);
	    i__1 = i__ << 1;
	    datra_(&i__1, & nom_ .bb1, & nom_ .bb2);
	    dacmu_(& nom_ .bb2, &coe, & vecteur_ .x[i__ - 1]);
 
	}
	jj[6] = 1;
	dapek_(vecteur_ .x, jj, &coefh1);
	dapek_(& vecteur_ .x[1], jj, &coefv1);
	jj[6] = 0;
	jj[7] = 1;
	dapek_(vecteur_ .x, jj, &coefh2);
	dapek_(& vecteur_ .x[1], jj, &coefv2);
	jj[7] = 0;
	det1 = coefh1 * coefv2 - coefv1 * coefh2;
	if ((( det1 ) >= 0 ? ( det1 ) : -( det1 ))  <= 1e-17) {
	    error_(&c__90);
	}
	cor6d[3] = coefv2 / det1;
	cor6d[5] = -coefh2 / det1;
	cor6d[4] = -coefv1 / det1;
	cor6d[6] = coefh1 / det1;
    }
    dadal_(& super_ .hs, &c__1);
    dadal_(vecteur_ .a1i, &c__12);
    dadal_(& vecteur_ .ft, &c__1);
    dadal_(& vecteur_ .h__, &c__1);
    dadal_(vecteur_ .xy, &c__12);
    dadal_(vecteur_ .x, &c__12);
    dadal_(vecteur_ .w, &c__12);
    dadal_(vecteur_ .v, &c__12);
    dadal_(vecteur_ .a1, &c__12);
    dadal_(vecteur_ .cm, &c__12);
    dadal_(vecteur_ .a2i, &c__12);
    dadal_(vecteur_ .a2, &c__12);
    dadal_(nom_ .rtc, &c__12);
    dadal_(nom_ .cjg, &c__12);
    dadal_(nom_ .ctr, &c__12);
    dadal_(& super_ .fs, &c__1);
    dadal_(nom_ .rel, &c__12);
    dadal_(nom_ .roti, &c__12);
    dadal_(nom_ .rot, &c__12);
    dadal_(& nom_ .bb2, &c__1);
    dadal_(& nom_ .bb1, &c__1);
    return 0;
}  

 
 
  int matrix_(dpp, am)
doublereal *dpp, *am;
{
    static integer i__, l, ierr;
    extern   int umlauf_();

 

 

     
    am -= 5;

     
    for (i__ = 2; i__ <= 5; ++i__) {
	for (l = 1; l <= 2; ++l) {
	    (tra_._1) .x[i__ + l * 6 - 7] = 0.;
 
	    (tra_._1) .y[i__ + l * 6 - 7] = 0.;
	}
    }
    (tra_._1) .x[1] = 1.;
    (tra_._1) .y[2] = 1.;
    (tra_._1) .x[9] = 1.;
    (tra_._1) .y[10] = 1.;
    for (l = 1; l <= 2; ++l) {
	(tra_._1) .x[l * 6 - 6] = (tra_._1) .clo[l - 1];
 
	(tra_._1) .y[l * 6 - 6] = (tra_._1) .clop[l - 1];
    }
    umlauf_(dpp, &c__5, &ierr);
    erro_ .ierro = ierr;
    for (i__ = 1; i__ <= 4; ++i__) {
	am[(i__ << 2) + 1] = (tra_._1) .x[i__];
	am[(i__ << 2) + 2] = (tra_._1) .y[i__];
	am[(i__ << 2) + 3] = (tra_._1) .x[i__ + 6];
 
	am[(i__ << 2) + 4] = (tra_._1) .y[i__ + 6];
    }
 

    return 0;
}  

 
 
integer maxmin_(a, n, m)
doublereal *a;
integer *n, *m;
{
     
    integer ret_val, i__1;

     
    static integer i__;
    static doublereal curent;

 
 
 
     
    --a;

     
    ret_val = 1;
    if (*n < 1) {
	return ret_val;
    }
    curent = a[1];
    i__1 = *n;
    for (i__ = 2; i__ <= i__1; ++i__) {
	if (*m == 0 && a[i__] >= curent) {
	    goto L10;
	}
	if (*m == 1 && a[i__] <= curent) {
	    goto L10;
	}
	curent = a[i__];
	ret_val = i__;
L10:
	;
    }
    return ret_val;
}  

 
 
  int midbloc6_(c__, a2, a2i, q)
integer *c__, *a2, *a2i;
doublereal *q;
{
     
    doublereal d__1, d__2, d__3;

     
    double atan();
    integer s_wsle(), do_lio(), e_wsle();
    double asin(), sqrt(), cos(), sin(), acos();
      int s_stop();

     
    static integer i__, j, k, l, n;
    static doublereal p[3], r__, w[36]	 , x, y, z__;
    static integer n1, i9;
    static doublereal s1[36]	 , t0, cm[36]	 
, qb[2], sa[36]	 , cr[36]	 
, qc[2];
    static integer kn;
    static doublereal ri[6];
    static integer kp, no, nn;
    static doublereal vi[36]	 , xd, yd;
    static integer jx[20];
    static doublereal xj[36]	 , rr[6];
    static integer nv;
    static doublereal xn, vr[36]	 , xq[6], xp, zd, xx, 
	    yy, zz, xn0, xp0;
    static integer ifl[6];
    static doublereal sai[36]	 , tst, x2pi;
    extern   int eig66_();
    static integer nrep;
    extern   int mul66_();
    static integer n1rep;
    extern   int daall_(), dapek_(), dapok_();
    static integer nnrep;
    static doublereal qdiff10, qdiff20, qdiff12, qdiff13, qdiff23;
    static integer iplane[3];
    extern   int dacond6_();
    static integer icount1, icount2;

     
    static cilist io___2976 = { 0, 6, 0, 0, 0 };
    static cilist io___2977 = { 0, 6, 0, 0, 0 };
    static cilist io___2983 = { 0, 6, 0, 0, 0 };
    static cilist io___2987 = { 0, 6, 0, 0, 0 };
    static cilist io___3004 = { 0, 6, 0, 0, 0 };
    static cilist io___3021 = { 0, 6, 0, 0, 0 };
    static cilist io___3022 = { 0, 6, 0, 0, 0 };
    static cilist io___3023 = { 0, 6, 0, 0, 0 };
    static cilist io___3024 = { 0, 6, 0, 0, 0 };
    static cilist io___3025 = { 0, 6, 0, 0, 0 };
    static cilist io___3026 = { 0, 6, 0, 0, 0 };
    static cilist io___3027 = { 0, 6, 0, 0, 0 };
    static cilist io___3028 = { 0, 6, 0, 0, 0 };
    static cilist io___3029 = { 0, 6, 0, 0, 0 };
    static cilist io___3030 = { 0, 6, 0, 0, 0 };
    static cilist io___3031 = { 0, 6, 0, 0, 0 };
    static cilist io___3032 = { 0, 6, 0, 0, 0 };
    static cilist io___3033 = { 0, 6, 0, 0, 0 };
    static cilist io___3034 = { 0, 6, 0, 0, 0 };
    static cilist io___3035 = { 0, 6, 0, 0, 0 };
    static cilist io___3036 = { 0, 6, 0, 0, 0 };
    static cilist io___3037 = { 0, 6, 0, 0, 0 };
    static cilist io___3038 = { 0, 6, 0, 0, 0 };
    static cilist io___3039 = { 0, 6, 0, 0, 0 };
    static cilist io___3040 = { 0, 6, 0, 0, 0 };
    static cilist io___3041 = { 0, 6, 0, 0, 0 };
    static cilist io___3042 = { 0, 6, 0, 0, 0 };
    static cilist io___3043 = { 0, 6, 0, 0, 0 };
    static cilist io___3044 = { 0, 6, 0, 0, 0 };
    static cilist io___3045 = { 0, 6, 0, 0, 0 };
    static cilist io___3046 = { 0, 6, 0, 0, 0 };


 
 



     
    --q;
    --a2i;
    --a2;
    --c__;

     
    daall_(&c__[1], &c__12, "C         ", &no, &nv, 10L);
    daall_(&a2[1], &c__12, "A2        ", &no, &nv, 10L);
    daall_(&a2i[1], &c__12, "A2I       ", &no, &nv, 10L);
 
    icount1 = 0;
    icount2 = 0;
    x2pi = atan(1.) * 8.;
L195:
    n1 = 0;
    for (i__ = 1; i__ <= 12; ++i__) {
 
	jx[i__ - 1] = 0;
    }
    for (i__ = 1; i__ <= 6; ++i__) {
	for (j = 1; j <= 6; ++j) {
	    jx[j - 1] = 1;
	    dapek_(&c__[i__], jx, &r__);
	    jx[j - 1] = 0;
	    cm[i__ + j * 6 - 7] = r__;
	    cr[j + i__ * 6 - 7] = r__;
	    xj[i__ + j * 6 - 7] = 0.;
	    s1[i__ + j * 6 - 7] = 0.;
 
	}
 
    }
    for (i__ = 1; i__ <= 3; ++i__) {
	xj[(i__ << 1) - 1 + i__ * 12 - 7] = 1.;
	xj[(i__ << 1) + ((i__ << 1) - 1) * 6 - 7] = -1.;
 
    }
    for (i__ = 1; i__ <= 6; ++i__) {
	for (j = 1; j <= 6; ++j) {
	    sai[i__ + j * 6 - 7] = 0.;
	    w[i__ + j * 6 - 7] = cm[i__ + j * 6 - 7];
	    sa[i__ + j * 6 - 7] = 0.;
 
	}
 
    }
    mul66_(xj, w);
    mul66_(cr, w);
    s_wsle(&io___2976);
    do_lio(&c__9, &c__1, "CHECK OF THE SYMPLECTIC CONDITION ON THE LINEAR PART", 52L);
    e_wsle();
    for (i__ = 1; i__ <= 6; ++i__) {
	s_wsle(&io___2977);
	for (j = 1; j <= 6; ++j) {
	    do_lio(&c__5, &c__1, (char *)&w[i__ + j * 6 - 7], (ftnlen)sizeof(
		    doublereal));
	}
	e_wsle();
 
    }
    eig66_(cr, rr, ri, vr, vi);
    for (i__ = 1; i__ <= 6; ++i__) {
	xq[i__ - 1] = asin(ri[i__ - 1]) / x2pi;
 
	s_wsle(&io___2983);
	do_lio(&c__3, &c__1, (char *)&i__, (ftnlen)sizeof(integer));
	do_lio(&c__5, &c__1, (char *)&xq[i__ - 1], (ftnlen)sizeof(doublereal))
		;
	e_wsle();
    }
    i9 = 6;
    qb[0] = q[1] / x2pi;
    qb[1] = q[2] / x2pi;
    qc[0] = q[1];
    qc[1] = q[2];
    s_wsle(&io___2987);
    do_lio(&c__9, &c__1, "SELECTING EIGENPLANES FOR NOMINAL TUNES ", 40L);
    do_lio(&c__5, &c__2, (char *)&qb[0], (ftnlen)sizeof(doublereal));
    e_wsle();
    if (qb[0] > .5) {
	qb[0] += -.5;
    }
    if (qb[1] > .5) {
	qb[1] += -.5;
    }
    if (i9 == 6) {
	xp0 = 1.;
	xn0 = -1.;
	for (j = 1; j <= 6; ++j) {
	    ifl[j - 1] = 1;
 
	    if ((d__1 = xq[j - 1]) < 0.) {
		goto L90;
	    } else if (d__1 == 0) {
		goto L190;
	    } else {
		goto L100;
	    }
L90:
	    xn = xq[j - 1];
	    if (xn > xn0) {
		xn0 = xn;
		kn = j;
	    }
	    goto L110;
L100:
	    xp = xq[j - 1];
	    if (xp < xp0) {
		xp0 = xp;
		kp = j;
	    }
L110:
	    ;
	}
	ifl[kp - 1] = 0;
 
	ifl[kn - 1] = 0;
	iplane[2] = kp;
	for (i__ = 1; i__ <= 2; ++i__) {
	    k = 1;
	    t0 = 1.;
	    for (j = 1; j <= 6; ++j) {
		if (ifl[j - 1] <= 0) {
		    goto L170;
		} else {
		    goto L120;
		}
L120:
		if ((d__1 = xq[j - 1]) < 0.) {
		    goto L130;
		} else if (d__1 == 0) {
		    goto L190;
		} else {
		    goto L140;
		}
L130:
		if (qb[i__ - 1] - .5 >= 0.) {
		    goto L150;
		} else {
		    goto L160;
		}
L140:
		if (qb[i__ - 1] - .5 <= 0.) {
		    goto L150;
		} else {
		    goto L160;
		}
L150:
		tst = (d__3 = (d__1 = qb[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) - (d__2 = xq[j 
			- 1], (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) ), (( d__3 ) >= 0 ? ( d__3 ) : -( d__3 )) );
		if (tst < t0) {
		    t0 = tst;
		    k = j;
		}
		goto L170;
L160:
L170:
		;
	    }
	    iplane[i__ - 1] = k;
	    ifl[k - 1] = 0;
 
	}
 
L190:
	n = iplane[0];
	nn = iplane[1];
	n1 = iplane[2];
	if (icount1 > 0 || icount2 > 0) {
	    n = nrep;
	    nn = nnrep;
	    n1 = n1rep;
	}
	s_wsle(&io___3004);
	do_lio(&c__9, &c__1, "EIGENPLANES :", 13L);
	do_lio(&c__3, &c__1, (char *)&n, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)&nn, (ftnlen)sizeof(integer));
	do_lio(&c__3, &c__1, (char *)&n1, (ftnlen)sizeof(integer));
	e_wsle();
    }
 
    x = vr[n * 6 - 6] * vi[n * 6 - 5] - vr[n * 6 - 5] * vi[n * 6 - 6] + vr[n *
	     6 - 4] * vi[n * 6 - 3] - vr[n * 6 - 3] * vi[n * 6 - 4];
    if (i9 == 6) {
	x = x + vr[n * 6 - 2] * vi[n * 6 - 1] - vr[n * 6 - 1] * vi[n * 6 - 2];
    }
    y = vr[nn * 6 - 6] * vi[nn * 6 - 5] - vr[nn * 6 - 5] * vi[nn * 6 - 6] + 
	    vr[nn * 6 - 4] * vi[nn * 6 - 3] - vr[nn * 6 - 3] * vi[nn * 6 - 4];
    if (i9 == 6) {
	y = y + vr[nn * 6 - 2] * vi[nn * 6 - 1] - vr[nn * 6 - 1] * vi[nn * 6 
		- 2];
    }
    if (i9 == 6) {
	z__ = vr[n1 * 6 - 6] * vi[n1 * 6 - 5] - vr[n1 * 6 - 5] * vi[n1 * 6 - 
		6] + vr[n1 * 6 - 4] * vi[n1 * 6 - 3] - vr[n1 * 6 - 3] * vi[n1 
		* 6 - 4] + vr[n1 * 6 - 2] * vi[n1 * 6 - 1] - vr[n1 * 6 - 1] * 
		vi[n1 * 6 - 2];
    }
    xx = 1.;
    yy = 1.;
    zz = 1.;
    if (x < 0.) {
	xx = -1.;
    }
    if (y < 0.) {
	yy = -1.;
    }
    if (z__ < 0.) {
	zz = -1.;
    }
    x = sqrt(((( x ) >= 0 ? ( x ) : -( x )) ));
    y = sqrt(((( y ) >= 0 ? ( y ) : -( y )) ));
    z__ = sqrt(((( z__ ) >= 0 ? ( z__ ) : -( z__ )) ));
    for (i__ = 1; i__ <= 6; ++i__) {
	sai[i__ * 6 - 6] = vr[i__ + n * 6 - 7] * xx / x;
	sai[i__ * 6 - 5] = vi[i__ + n * 6 - 7] / x;
	sai[i__ * 6 - 4] = vr[i__ + nn * 6 - 7] * yy / y;
	sai[i__ * 6 - 3] = vi[i__ + nn * 6 - 7] / y;
 
	sai[i__ * 6 - 2] = vr[i__ + n1 * 6 - 7] * zz / z__;
	sai[i__ * 6 - 1] = vi[i__ + n1 * 6 - 7] / z__;
 
 
 
 
 
    }
 

 
    for (i__ = 1; i__ <= 3; ++i__) {
	p[i__ - 1] = atan(-sai[(i__ << 1) - 1 + i__ * 12 - 7] / sai[(i__ << 1)
		 + i__ * 12 - 7]);
	s1[(i__ << 1) - 1 + ((i__ << 1) - 1) * 6 - 7] = cos(p[i__ - 1]);
	s1[(i__ << 1) + i__ * 12 - 7] = cos(p[i__ - 1]);
	s1[(i__ << 1) - 1 + i__ * 12 - 7] = sin(p[i__ - 1]);
 
	s1[(i__ << 1) + ((i__ << 1) - 1) * 6 - 7] = -sin(p[i__ - 1]);
    }
    mul66_(s1, sai);
 
    xd = 1.;
    yd = 1.;
    zd = 1.;
    if (sai[0] < 0.) {
	xd = -1.;
    }
    if (sai[14] < 0.) {
	yd = -1.;
    }
    if (sai[28] < 0.) {
	zd = -1.;
    }
    s1[0] = xd;
    s1[6] = 0.;
    s1[1] = 0.;
    s1[7] = xd;
    s1[14] = yd;
    s1[20] = 0.;
    s1[15] = 0.;
    s1[21] = yd;
    s1[28] = zd;
    s1[34] = 0.;
    s1[29] = 0.;
    s1[35] = zd;
    mul66_(s1, sai);
 
    for (i__ = 1; i__ <= 6; ++i__) {
	for (j = 1; j <= 6; ++j) {
	    for (k = 1; k <= 6; ++k) {
		for (l = 1; l <= 6; ++l) {
		    sa[i__ + l * 6 - 7] = -xj[i__ + j * 6 - 7] * sai[k + j * 
			    6 - 7] * xj[k + l * 6 - 7] + sa[i__ + l * 6 - 7];
 
		}
 
	    }
 
	}
 
    }
    mul66_(sai, cm);
    for (i__ = 1; i__ <= 6; ++i__) {
	for (j = 1; j <= 6; ++j) {
 
	    cr[i__ + j * 6 - 7] = sa[i__ + j * 6 - 7];
	}
 
    }
    mul66_(cm, cr);
    for (i__ = 1; i__ <= 3; ++i__) {
	q[i__] = acos(cr[(i__ << 1) - 1 + ((i__ << 1) - 1) * 6 - 7]);
 
	if (cr[(i__ << 1) - 1 + i__ * 12 - 7] < 0.) {
	    q[i__] = x2pi - q[i__];
	}
 
    }
    qdiff10 = (d__1 = qc[0] - q[1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
    qdiff20 = (d__1 = qc[1] - q[2], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
    qdiff12 = (d__1 = qc[0] - q[2], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
    qdiff13 = (d__1 = qc[0] - q[3], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
    qdiff23 = (d__1 = qc[1] - q[3], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
    if (qdiff10 < qdiff13 && qdiff20 < qdiff13) {
	if (qdiff10 > qdiff12) {
	    if (icount1 == 0) {
		s_wsle(&io___3021);
		e_wsle();
		s_wsle(&io___3022);
		do_lio(&c__9, &c__1, "WARNING: REORDER EIGENPLANES", 28L);
		e_wsle();
		s_wsle(&io___3023);
		do_lio(&c__9, &c__1, "WRONG IN HORIZONTAL PLANE", 25L);
		e_wsle();
		s_wsle(&io___3024);
		e_wsle();
		nrep = nn;
		nnrep = n;
		n1rep = n1;
		++icount1;
		q[1] = qc[0];
		q[2] = qc[1];
		goto L195;
	    } else {
		s_wsle(&io___3025);
		do_lio(&c__9, &c__1, "ERROR: PROBLEM WITH THE TUNE EIGENPLANES", 40L);
		e_wsle();
		s_wsle(&io___3026);
		do_lio(&c__9, &c__1, "PROGRAM STOP", 12L);
		e_wsle();
		s_wsle(&io___3027);
		e_wsle();
		s_stop("", 0L);
	    }
	}
    } else {
	if (qdiff10 > qdiff13) {
	    if (icount2 == 0) {
		s_wsle(&io___3028);
		e_wsle();
		s_wsle(&io___3029);
		do_lio(&c__9, &c__1, "WARNING: REORDER EIGENPLANES", 28L);
		e_wsle();
		s_wsle(&io___3030);
		do_lio(&c__9, &c__1, "WRONG IN LONGITUDINAL PLANE", 27L);
		e_wsle();
		s_wsle(&io___3031);
		do_lio(&c__9, &c__1, "REPLACE WITH HORIZONTAL", 23L);
		e_wsle();
		s_wsle(&io___3032);
		e_wsle();
		nrep = n1;
		nnrep = nn;
		n1rep = n;
		++icount2;
		q[1] = qc[0];
		q[2] = qc[1];
		goto L195;
	    } else {
		s_wsle(&io___3033);
		do_lio(&c__9, &c__1, "ERROR: PROBLEM WITH THE TUNE EIGENPLANES", 40L);
		e_wsle();
		s_wsle(&io___3034);
		do_lio(&c__9, &c__1, "PROGRAM STOP", 12L);
		e_wsle();
		s_wsle(&io___3035);
		e_wsle();
		s_stop("", 0L);
	    }
	} else if (qdiff20 > qdiff23 && qdiff10 < qdiff13) {
	    if (icount2 == 0) {
		s_wsle(&io___3036);
		e_wsle();
		s_wsle(&io___3037);
		do_lio(&c__9, &c__1, "WARNING: REORDER EIGENPLANES", 28L);
		e_wsle();
		s_wsle(&io___3038);
		do_lio(&c__9, &c__1, "WRONG IN LONGITUDINAL PLANE", 27L);
		e_wsle();
		s_wsle(&io___3039);
		do_lio(&c__9, &c__1, "REPLACE WITH VERTICAL", 21L);
		e_wsle();
		s_wsle(&io___3040);
		e_wsle();
		nrep = n;
		nnrep = n1;
		n1rep = nn;
		++icount2;
		q[1] = qc[0];
		q[2] = qc[1];
		goto L195;
	    } else {
		s_wsle(&io___3041);
		do_lio(&c__9, &c__1, "ERROR: PROBLEM WITH THE TUNE EIGENPLANES", 40L);
		e_wsle();
		s_wsle(&io___3042);
		do_lio(&c__9, &c__1, "PROGRAM STOP", 12L);
		e_wsle();
		s_wsle(&io___3043);
		e_wsle();
		s_stop("", 0L);
	    }
	} else {
	    s_wsle(&io___3044);
	    do_lio(&c__9, &c__1, "ERROR: PROBLEM WITH THE TUNE EIGENPLANES", 
		    40L);
	    e_wsle();
	    s_wsle(&io___3045);
	    do_lio(&c__9, &c__1, "PROGRAM STOP", 12L);
	    e_wsle();
	    s_wsle(&io___3046);
	    e_wsle();
	    s_stop("", 0L);
	}
    }
    dacond6_(&a2[1], &c_b251);
    dacond6_(&a2i[1], &c_b251);
    for (i__ = 1; i__ <= 6; ++i__) {
	for (j = 1; j <= 6; ++j) {
	    jx[j - 1] = 1;
	    r__ = sa[i__ + j * 6 - 7];
	    if (r__ != 0.) {
		dapok_(&a2[i__], jx, &r__);
	    }
	    jx[j - 1] = 1;
	    r__ = sai[i__ + j * 6 - 7];
	    if (r__ != 0.) {
		dapok_(&a2i[i__], jx, &r__);
	    }
	    jx[j - 1] = 0;
 
	}
 
    }
    return 0;
}  

 
  int mul66_(rt, r__)
doublereal *rt, *r__;
{
    static integer i__, j, ia;
    static doublereal rtt[36]	 ;

     
    r__ -= 7;
    rt -= 7;

     
    for (i__ = 1; i__ <= 6; ++i__) {
	for (j = 1; j <= 6; ++j) {
 
	    rtt[i__ + j * 6 - 7] = 0.;
	}
 
    }
    for (i__ = 1; i__ <= 6; ++i__) {
	for (j = 1; j <= 6; ++j) {
	    for (ia = 1; ia <= 6; ++ia) {
		rtt[i__ + ia * 6 - 7] = rt[i__ + j * 6] * r__[j + ia * 6] + 
			rtt[i__ + ia * 6 - 7];
 
	    }
 
	}
 
    }
    for (i__ = 1; i__ <= 6; ++i__) {
	for (j = 1; j <= 6; ++j) {
	    r__[i__ + j * 6] = rtt[i__ + j * 6 - 7];
 
	}
 
    }
    return 0;
}  

  int mywwerf_(zr, zi, wr, wi)
doublereal *zr, *zi, *wr, *wi;
{
     
    doublereal d__1, d__2;

     
    double exp(), cos(), sin();

     
    static integer n;
    static doublereal x, y, xa, ya, ri[37], ti, si, vi, rr[37], xl, tr, sr, 
	    vr, zhi, zhr;

    x = *zr;
    y = *zi;
    xa = (( x ) >= 0 ? ( x ) : -( x )) ;
    ya = (( y ) >= 0 ? ( y ) : -( y )) ;
    if (ya < 7.4000000000000004 && xa < 8.3000000000000007) {
	zhr = ya + 1.6000000000000001;
	zhi = xa;
	rr[36] = 0.;
	ri[36] = 0.;
	for (n = 36; n >= 1; --n) {
 
	    tr = zhr + n * rr[n];
	    ti = zhi - n * ri[n];
 
 
	    d__1 = tr;
 
	    d__2 = ti;
	    rr[n - 1] = tr * .5 / (d__1 * d__1 + d__2 * d__2);
 
	    d__1 = tr;
 
	    d__2 = ti;
	    ri[n - 1] = ti * .5 / (d__1 * d__1 + d__2 * d__2);
 
	}
	xl = 46768052394589056.;
	sr = 0.;
	si = 0.;
	for (n = 33; n >= 1; --n) {
	    xl *= .3125;
 
 
 
	    d__1 = sr + xl;
 
	    d__2 = si + xl;
	    sr = (rr[n - 1] * (sr + xl) + ri[n - 1] * (si + xl)) / (d__1 * 
		    d__1 + d__2 * d__2);
 
	    d__1 = sr + xl;
 
	    d__2 = si + xl;
	    si = (ri[n - 1] * (sr + xl) - rr[n - 1] * (si + xl)) / (d__1 * 
		    d__1 + d__2 * d__2);
 
	}
	vr = sr * 1.12837916709551257;
	vi = si * 1.12837916709551257;
    } else {
	zhr = ya;
	zhi = xa;
	rr[0] = 0.;
	ri[0] = 0.;
	for (n = 9; n >= 1; --n) {
 
	    tr = zhr + n * rr[0];
	    ti = zhi - n * ri[0];
 
 
	    d__1 = tr;
 
	    d__2 = ti;
	    rr[0] = tr * .5 / (d__1 * d__1 + d__2 * d__2);
 
	    d__1 = tr;
 
	    d__2 = ti;
	    ri[0] = ti * .5 / (d__1 * d__1 + d__2 * d__2);
 
	}
	vr = rr[0] * 1.12837916709551257;
	vi = ri[0] * 1.12837916709551257;
    }
    if (ya == 0.) {
 
	d__1 = xa;
	vr = exp(-(d__1 * d__1));
    } else if (y < 0.) {
 
	vr = exp(xa) * 2 * cos(ya) - vr;
	vi = exp(xa) * 2 * sin(ya) - vi;
	if (x > 0. || x < 0.) {
	    vi = -vi;
	}
    }
    *wr = vr;
    *wi = vi;
    return 0;
}  

 
 
  int orbinit_()
{
     
    integer i__1;

     
    static integer i__;
    static doublereal r0;
    static integer im, ix, izu, kpz, kzz, nmz;

 

 
 

 

 

    izu = 0;
    i__1 = str_ .iu;
    for (i__ = 1; i__ <= i__1; ++i__) {
	ix = str_ .ic[i__ - 1];
	if (ix <= 300) {
	    goto L10;
	}
	ix += -300;
	kpz = ell_ .kp[ix - 1];
	kzz = ell_ .kz[ix - 1];
	if (kpz == 6 || kzz == 0) {
	    goto L10;
	}
	if (rand0_ .iorg < 0) {
	    rand0_ .mzu[i__ - 1] = izu;
	}
	izu = rand0_ .mzu[i__ - 1] + 1;
	if (kpz == 4 && kzz == 1 || kpz == -4 && kzz == -1) {
	    rand0_ .zfz[izu - 1] = 0.;
	    ell_ .ek[ix - 1] = 1.;
	    cororb_ .ncororb[ix - 1] = 1;
	}
	izu += 2;
	if (kzz == 11) {
	    r0 = ell_ .ek[ix - 1];
	    if ((( r0 ) >= 0 ? ( r0 ) : -( r0 ))  <= 1e-17) {
		goto L10;
	    }
	    nmz = mult1_ .nmu[ix - 1];
	    if (nmz == 0) {
		izu += 22;
		goto L10;
	    }
	    im = mult1_ .irm[ix - 1];
	    ++izu;
	    if (kpz == -4) {
		rand0_ .zfz[izu - 1] = 0.;
		multi_ .aka[im - 1] = 1.;
	    }
	    ++izu;
	    if (kpz == 4) {
		rand0_ .zfz[izu - 1] = 0.;
		multi_ .bka[im - 1] = 1.;
	    }
	    izu += 20;
	}
L10:
	;
    }
    return 0;
}  

 
 
  int ord_()
{
     
    integer i__1, i__2;
    doublereal d__1;

     
    integer s_cmp();
    double cos(), sin();

     
    static integer i__, j, ii, ix, ilf[20000], jra[3500]	 
, inz[700], ilfr[20000], iran[700], ihi, izu, nra1, kpz, kzz,
	     kzz1, kzz2, jra3, kanf1;
    extern   int error_();
    static integer icext1[20000];
    static doublereal exterr1[800000]	 ;
    static integer icextal1[20000];
    static doublereal extalig1[60000]	 ;

 

 
 

 

    for (i__ = 1; i__ <= 20000; ++i__) {
	ilf[i__ - 1] = 0;
	ilfr[i__ - 1] = 0;
 
    }
    for (i__ = 1; i__ <= 700; ++i__) {
	iran[i__ - 1] = 0;
	inz[i__ - 1] = 0;
	for (j = 1; j <= 5; ++j) {
	    jra[i__ + j * 700 - 701] = 0;
 
	}
    }
    if (str_ .mper == 1) {
	goto L40;
    }
    i__1 = str_ .mper;
    for (i__ = 2; i__ <= i__1; ++i__) {
	i__2 = str_ .mbloz;
	for (j = 1; j <= i__2; ++j) {
	    ii = (i__ - 1) * str_ .mbloz + j;
	    ihi = j;
	    if (str_ .msym[i__ - 1] < 0) {
		ihi = str_ .mbloz - j + 1;
	    }
	    str_ .ic[ii - 1] = str_ .msym[i__ - 1] * str_ .ic[ihi - 1];
 
	    if (str_ .ic[ii - 1] < -300) {
		str_ .ic[ii - 1] = - str_ .ic[ii - 1];
	    }
	}
    }
 
L40:
    str_ .iu = str_ .mper * str_ .mbloz;
    izu = 0;
    nra1 = 280000;
    -- rand0_ .iorg;
    if (rand0_ .iorg >= 0) {
	if (rand0_ .iorg == 0) {
	    i__2 = str_ .iu;
	    for (i__ = 1; i__ <= i__2; ++i__) {
		ix = str_ .ic[i__ - 1];
		if (ix <= 300) {
		    goto L50;
		}
		ix += -300;
		kpz = ell_ .kp[ix - 1];
		kzz = ell_ .kz[ix - 1];
		if (kpz == 6 || kzz == 0) {
		    goto L50;
		}
		rand0_ .mzu[i__ - 1] = izu;
		izu += 3;
		if (kzz == 11 && (d__1 = ell_ .ek[ix - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17)
			 {
		    izu += 22;
		}
		if (izu > 280000) {
		    error_(&c__30);
		}
L50:
		;
	    }
	} else {
	    i__2 = rand0_ .iorg;
	    for (i__ = 1; i__ <= i__2; ++i__) {
		i__1 = str_ .il;
		for (j = 1; j <= i__1; ++j) {
		    if (s_cmp(linopc_ .bez + (j - 1 << 4), rand0c_ .bezr + (
			    i__ * 3 - 3 << 4), 16L, 16L) == 0) {
			jra[i__ - 1] = j;
			if (ell_ .kz[j - 1] == 0) {
			    error_(&c__31);
			}
			jra[i__ + 699] = ell_ .kz[j - 1];
		    }
		    if (s_cmp(linopc_ .bez + (j - 1 << 4), rand0c_ .bezr + (
			    i__ * 3 - 2 << 4), 16L, 16L) == 0) {
			jra[i__ + 1399] = j;
			if (ell_ .kz[j - 1] == 0) {
			    error_(&c__31);
			}
			jra[i__ + 2099] = ell_ .kz[j - 1];
		    }
 
		}
		kzz1 = jra[i__ + 699];
		kzz2 = jra[i__ + 2099];
		if (kzz1 != 0 && kzz2 == 0) {
		    jra[i__ + 2799] = nra1;
		    nra1 += 1500;
		    if (kzz1 == 11 && (d__1 = ell_ .ek[jra[i__ - 1] - 1], (( 
			    d__1 ) >= 0 ? (  			    d__1 ) : -(  			    d__1 )) ) > 1e-17) {
			nra1 += 11000;
		    }
		    if (nra1 > 300000) {
			error_(&c__32);
		    }
		}
		if (kzz1 == 11 && (kzz2 != 11 && kzz2 != 0)) {
		    error_(&c__33);
		}
 
	    }
	    i__2 = str_ .iu;
	    for (i__ = 1; i__ <= i__2; ++i__) {
		ix = str_ .ic[i__ - 1];
		if (ix <= 300) {
		    goto L110;
		}
		ix += -300;
		kpz = ell_ .kp[ix - 1];
		kzz = ell_ .kz[ix - 1];
		if (kpz == 6 || kzz == 0) {
		    goto L110;
		}
		i__1 = rand0_ .iorg;
		for (j = 1; j <= i__1; ++j) {
		    if (s_cmp(linopc_ .bez + (ix - 1 << 4), rand0c_ .bezr + (
			    j * 3 - 3 << 4), 16L, 16L) == 0) {
			goto L90;
		    }
 
		}
		goto L100;
L90:
		jra3 = jra[j + 1399];
		if (jra3 != 0) {
		    rand0_ .mzu[i__ - 1] = iran[jra3 - 1];
		    iran[ix - 1] = rand0_ .mzu[i__ - 1];
		} else {
		    ++inz[j - 1];
		    if (inz[j - 1] > 500) {
			error_(&c__34);
		    }
		    rand0_ .mzu[i__ - 1] = jra[j + 2799];
		    iran[ix - 1] = rand0_ .mzu[i__ - 1];
		    jra[j + 2799] += 3;
		    if (jra[j + 699] == 11) {
			jra[j + 2799] += 22;
		    }
		}
		goto L110;
L100:
		rand0_ .mzu[i__ - 1] = izu;
		iran[ix - 1] = izu;
		izu += 3;
		if (kzz == 11 && (d__1 = ell_ .ek[ix - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17)
			 {
		    izu += 22;
		}
		if (izu > 280000) {
		    error_(&c__30);
		}
L110:
		;
	    }
	}
    } else {
	i__2 = str_ .iu;
	for (i__ = 1; i__ <= i__2; ++i__) {
	    ix = str_ .ic[i__ - 1];
	    if (ix <= 300) {
		goto L115;
	    }
	    ix += -300;
	    kpz = ell_ .kp[ix - 1];
	    kzz = ell_ .kz[ix - 1];
	    if (kpz == 6 || kzz == 0) {
		goto L115;
	    }
	    izu += 3;
	    if (kzz == 11 && (d__1 = ell_ .ek[ix - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		izu += 22;
	    }
	    if (izu > 280000) {
		error_(&c__30);
	    }
L115:
	    ;
	}
    }
    if (str_ .kanf != 1) {
 
	kanf1 = str_ .kanf - 1;
	i__2 = kanf1;
	for (i__ = 1; i__ <= i__2; ++i__) {
	    if (rand0_ .iorg >= 0) {
		ilfr[i__ - 1] = rand0_ .mzu[i__ - 1];
	    }
	    ilf[i__ - 1] = str_ .ic[i__ - 1];
	    icext1[i__ - 1] = rand1_ .icext[i__ - 1];
	    icextal1[i__ - 1] = rand1_ .icextal[i__ - 1];
	    extalig1[i__ - 1] = rand1_ .extalign[i__ - 1];
	    extalig1[i__ + 19999] = rand1_ .extalign[i__ + 19999];
	    extalig1[i__ + 39999] = rand1_ .extalign[i__ + 39999];
	    for (ii = 1; ii <= 40; ++ii) {
		exterr1[i__ + ii * 20000 - 20001] = rand1_ .exterr[i__ + ii * 
			20000 - 20001];
 
	    }
 
	}
	i__2 = str_ .iu;
	for (i__ = str_ .kanf; i__ <= i__2; ++i__) {
	    if (rand0_ .iorg >= 0) {
		rand0_ .mzu[i__ - kanf1 - 1] = rand0_ .mzu[i__ - 1];
	    }
	    str_ .ic[i__ - kanf1 - 1] = str_ .ic[i__ - 1];
	    rand1_ .icext[i__ - kanf1 - 1] = rand1_ .icext[i__ - 1];
	    rand1_ .icextal[i__ - kanf1 - 1] = rand1_ .icextal[i__ - 1];
	    rand1_ .extalign[i__ - kanf1 - 1] = rand1_ .extalign[i__ - 1];
	    rand1_ .extalign[i__ - kanf1 + 19999] = rand1_ .extalign[i__ + 
		    19999];
	    rand1_ .extalign[i__ - kanf1 + 39999] = rand1_ .extalign[i__ + 
		    39999];
	    for (ii = 1; ii <= 40; ++ii) {
		rand1_ .exterr[i__ - kanf1 + ii * 20000 - 20001] = 
			rand1_ .exterr[i__ + ii * 20000 - 20001];
 
	    }
 
	}
	i__2 = kanf1;
	for (i__ = 1; i__ <= i__2; ++i__) {
	    if (rand0_ .iorg >= 0) {
		rand0_ .mzu[str_ .iu - kanf1 + i__ - 1] = ilfr[i__ - 1];
	    }
	    str_ .ic[str_ .iu - kanf1 + i__ - 1] = ilf[i__ - 1];
	    rand1_ .icext[str_ .iu - kanf1 + i__ - 1] = icext1[i__ - 1];
	    rand1_ .icextal[str_ .iu - kanf1 + i__ - 1] = icextal1[i__ - 1];
	    rand1_ .extalign[str_ .iu - kanf1 + i__ - 1] = extalig1[i__ - 1];
	    rand1_ .extalign[str_ .iu - kanf1 + i__ + 19999] = extalig1[i__ + 
		    19999];
	    rand1_ .extalign[str_ .iu - kanf1 + i__ + 39999] = extalig1[i__ + 
		    39999];
	    for (ii = 1; ii <= 40; ++ii) {
		rand1_ .exterr[str_ .iu - kanf1 + i__ + ii * 20000 - 20001] = 
			exterr1[i__ + ii * 20000 - 20001];
 
	    }
 
	}
    }
    izu = 0;
    i__2 = str_ .iu;
    for (i__ = 1; i__ <= i__2; ++i__) {
	ix = str_ .ic[i__ - 1];
	if (ix <= 300) {
	    goto L190;
	}
	ix += -300;
	kpz = ell_ .kp[ix - 1];
	kzz = ell_ .kz[ix - 1];
	if (kpz == 6 || kzz == 0) {
	    goto L190;
	}
	if (rand1_ .icextal[i__ - 1] != 0) {
	    izu += 2;
	    pla_ .xrms[ix - 1] = 1.;
	    pla_ .zrms[ix - 1] = 1.;
	    rand0_ .zfz[izu - 1] = rand1_ .extalign[i__ - 1];
	    ++izu;
	    rand0_ .zfz[izu - 1] = rand1_ .extalign[i__ + 19999];
	    rand1_ .tiltc[i__ - 1] = cos(rand1_ .extalign[i__ + 39999] * .001)
		    ;
	    rand1_ .tilts[i__ - 1] = sin(rand1_ .extalign[i__ + 39999] * .001)
		    ;
	} else {
	    izu += 3;
	}
	if (kzz == 11 && (d__1 = ell_ .ek[ix - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17 && 
		rand1_ .icext[i__ - 1] != 0) {
	    for (j = 1; j <= 11; ++j) {
		++izu;
		rand0_ .zfz[izu - 1] = rand1_ .exterr[i__ + (j + 20) * 20000 
			- 20001];
		++izu;
		rand0_ .zfz[izu - 1] = rand1_ .exterr[i__ + j * 20000 - 20001]
			;
 
	    }
	} else if (kzz == 11 && (d__1 = ell_ .ek[ix - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17 
		&& rand1_ .icext[i__ - 1] == 0) {
	    izu += 22;
	}
L190:
	;
    }
    return 0;
}  

 
  int orderma6_(h__, ft, x, v, w, rel, cjg, ctr, rtc, roti)
integer *h__, *ft, *x, *v, *w, *rel, *cjg, *ctr, *rtc, *roti;
{
     

    static integer b1 = 0;
    static integer b5 = 0;
    static integer b6 = 0;
    static integer b9 = 0;

     
    integer i__1, i__2;

     
    integer s_wsle(), do_lio(), e_wsle();

     
    static integer k, kp;
    extern   int trx6_(), intd6_(), daadd_(), dadal_(), daall_(
	    ), dacct_(), dacon_(), dacop_(), taked6_(), fexpo6_(), analie6_();

     
    static cilist io___3103 = { 0, 6, 0, 0, 0 };


 
 
 
 
 
 

 
 


     
    --roti;
    --rtc;
    --ctr;
    --cjg;
    --rel;
    --w;
    --v;
    --x;

     

    daall_(&x[1], &c__12, "X         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&w[1], &c__12, "W         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&v[1], &c__12, "V         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&rel[1], &c__12, "REL       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&cjg[1], &c__12, "CJG       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&ctr[1], &c__12, "CTR       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&rtc[1], &c__12, "RTC       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(h__, &c__1, "H         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(ft, &c__1, "FT        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&roti[1], &c__12, "ROTI      ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&b1, &c__1, "B1        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&b5, &c__1, "B5        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&b6, &c__1, "B6        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&b9, &c__1, "B9        ", & ii_ .no, & ii_ .nv, 10L);
 
    dacon_(h__, &c_b251);
    dacon_(ft, &c_b251);
    i__1 = ii_ .no - 1;
    for (k = 2; k <= i__1; ++k) {
	kp = k + 1;
 
	fexpo6_(h__, &x[1], &v[1], &c__3, &k, &c_b2381, &c_n1);
 
	taked6_(&v[1], &k, &w[1]);
 
	intd6_(&w[1], &b5, &rel[1]);
 
 
	analie6_(&b5, &b6, &cjg[1], &ctr[1], &rtc[1]);
	daadd_(&b5, h__, &b1);
	dacop_(&b1, h__);
 
	trx6_(&b6, &b9, &roti[1]);
 
	fexpo6_(&b6, &rel[1], &v[1], &kp, &kp, &c_b2381, &c__1);
 
	dacct_(&v[1], &c__6, &x[1], & ii_ .nv, &w[1], &c__6);
	s_wsle(&io___3103);
	do_lio(&c__9, &c__1, " ORDERMAP K= ", 13L);
	i__2 = k + 1;
	do_lio(&c__3, &c__1, (char *)&i__2, (ftnlen)sizeof(integer));
	e_wsle();
 
	fexpo6_(&b9, &w[1], &x[1], &kp, &kp, &c_b2366, &c__1);
 
	daadd_(&b6, ft, &b1);
	dacop_(&b1, ft);
 
    }
    dadal_(&b9, &c__1);
    dadal_(&b6, &c__1);
    dadal_(&b5, &c__1);
    dadal_(&b1, &c__1);
    return 0;
}  

 
 
  int phasad_(dpp, qwc)
doublereal *dpp, *qwc;
{
     
    integer i__1, i__2, i__3;
    doublereal d__1;

     
    double atan();

     
    static integer i__, j, k, l;
    static doublereal t[20]	 ;
    static integer l1;
    static doublereal r0, aa[11], bb[11];
    static integer dj;
    static doublereal cr[11], ci[11];
    static integer ll, ix;
    static doublereal qw[2];
    static integer jj, jm, jk;
    static doublereal qu, qv, xs, zs, xl, zl;
    static integer im;
    static doublereal r0a, qu1, alfa[2], phi[2], beta[2], dpr[5];
    static integer ium;
    static doublereal pie;
    static integer ikpv, izu;
    static doublereal dphi, puf, phibf[2], dyy1, dyy2;
    extern   int clorb_();
    static integer kpz, kzz, kpv;
    extern   int envar_(), error_();
    static doublereal qxsa, qxse, ekk, crkve, cikve, dppi;
    static integer nmz;
    static doublereal benkr, dyy11;
    extern   int betalf_();
    static doublereal tiltck, tiltsk, crkveuk;

 

 
 

 

     
    --qwc;

     
    ium = 5;
    i__1 = ium;
    for (i__ = 1; i__ <= i__1; ++i__) {
	dpr[i__ - 1] = 0.;
 
    }
    i__1 = ium;
    for (i__ = 1; i__ <= i__1; ++i__) {
	for (j = 1; j <= 4; ++j) {
	    t[i__ + j * 5 - 6] = 0.;
 
	}
    }
    for (i__ = 1; i__ <= 2; ++i__) {
	beta[i__ - 1] = 0.;
	alfa[i__ - 1] = 0.;
	phi[i__ - 1] = 0.;
	phibf[i__ - 1] = 0.;
	qw[i__ - 1] = 0.;
	qwc[i__] = 0.;
 
    }
    qwc[3] = 0.;
    for (i__ = 1; i__ <= 11; ++i__) {
	aa[i__ - 1] = 0.;
	bb[i__ - 1] = 0.;
	cr[i__ - 1] = 0.;
	ci[i__ - 1] = 0.;
 
    }
    pie = kons_ .pi * 2.;
    ikpv = 0;
    dpr[0] = *dpp * 1e3;
    clorb_(dpp);
    betalf_(dpp, qw);
    if (erro_ .ierro != 0) {
	i__1 = erro_ .ierro + 22;
	error_(&i__1);
    }
    envar_(dpp);
 
    for (l = 1; l <= 2; ++l) {
	ll = l << 1;
	alfa[l - 1] = (tra_._1) .alf0[l - 1];
	beta[l - 1] = (tra_._1) .bet0[l - 1];
	t[(ll - 1) * 5 - 5] = (tra_._1) .clo[l - 1];
 
	t[ll * 5 - 5] = (tra_._1) .clop[l - 1];
    }
    for (i__ = 1; i__ <= 4; ++i__) {
	for (j = 1; j <= 4; ++j) {
	    t[i__ + 1 + j * 5 - 6] = beo_ .ta[j + i__ * 6 - 7];
 
	    t[i__ + 1 + j * 5 - 6] = beo_ .ta[j + i__ * 6 - 7];
	}
    }
 
    izu = 0;
    i__1 = str_ .iu;
    for (k = 1; k <= i__1; ++k) {
	ix = str_ .ic[k - 1];
	if (ix > 300) {
	    goto L140;
	}
	jj = 0;
	dj = 1;
	if (ix > 0) {
	    goto L70;
	}
	ix = -ix;
	jj = str2_ .mel[ix - 1] + 1;
	dj = -1;
L70:
	jm = str2_ .mel[ix - 1];
 
	i__2 = jm;
	for (j = 1; j <= i__2; ++j) {
	    jj += dj;
	    jk = str2_ .mtyp[ix + jj * 300 - 301];
	    if (tit_ .ithick == 1 && ell_ .kz[jk - 1] != 0) {
		goto L100;
	    }
	    if (tit_ .ithick == 0 && ell_ .kz[jk - 1] != 0) {
		goto L450;
	    }
 
	    for (l = 1; l <= 2; ++l) {
		ll = l << 1;
		if ((d__1 = t[ll + (ll - 1) * 5 - 6], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		    phibf[l - 1] = atan(t[ll + 1 + (ll - 1) * 5 - 6] / t[ll + 
			    (ll - 1) * 5 - 6]);
		} else {
		    phibf[l - 1] = kons_ .pi2;
		}
		i__3 = ium;
		for (i__ = 1; i__ <= i__3; ++i__) {
 
		    t[i__ + (ll - 1) * 5 - 6] += t[i__ + ll * 5 - 6] * 
			    ell_ .el[jk - 1];
		}
	    }
	    for (l = 1; l <= 2; ++l) {
		ll = l << 1;
		beta[l - 1] = t[ll + (ll - 1) * 5 - 6] * t[ll + (ll - 1) * 5 
			- 6] + t[ll + 1 + (ll - 1) * 5 - 6] * t[ll + 1 + (ll 
			- 1) * 5 - 6];
		alfa[l - 1] = -(t[ll + (ll - 1) * 5 - 6] * t[ll + ll * 5 - 6] 
			+ t[ll + 1 + (ll - 1) * 5 - 6] * t[ll + 1 + ll * 5 - 
			6]);
		if ((d__1 = t[ll + (ll - 1) * 5 - 6], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		    dphi = atan(t[ll + 1 + (ll - 1) * 5 - 6] / t[ll + (ll - 1)
			     * 5 - 6]) - phibf[l - 1];
		} else {
		    dphi = kons_ .pi2 - phibf[l - 1];
		}
		if (-dphi > 1e-17) {
		    dphi += kons_ .pi;
		}
 
		phi[l - 1] += dphi / pie;
	    }
	    goto L130;
 
L100:
	    for (l = 1; l <= 2; ++l) {
		ll = l << 1;
		if ((d__1 = t[ll + (ll - 1) * 5 - 6], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		    phibf[l - 1] = atan(t[ll + 1 + (ll - 1) * 5 - 6] / t[ll + 
			    (ll - 1) * 5 - 6]);
		} else {
		    phibf[l - 1] = 0.;
		}
		i__3 = ium;
		for (i__ = 1; i__ <= i__3; ++i__) {
		    puf = t[i__ + (ll - 1) * 5 - 6];
		    t[i__ + (ll - 1) * 5 - 6] = puf * mat_ .a[jk + (l + 2) * 
			    700 - 2101] + t[i__ + ll * 5 - 6] * mat_ .a[jk + (
			    l + 4) * 700 - 2101] + dpr[i__ - 1] * mat_ .a[jk 
			    + (l + 10) * 700 - 2101];
 
		    t[i__ + ll * 5 - 6] = puf * mat_ .a[jk + (l + 6) * 700 - 
			    2101] + t[i__ + ll * 5 - 6] * mat_ .a[jk + (l + 8)
			     * 700 - 2101] + dpr[i__ - 1] * mat_ .a[jk + (l + 
			    12) * 700 - 2101];
		}
	    }
	    for (l = 1; l <= 2; ++l) {
		ll = l << 1;
		beta[l - 1] = t[ll + (ll - 1) * 5 - 6] * t[ll + (ll - 1) * 5 
			- 6] + t[ll + 1 + (ll - 1) * 5 - 6] * t[ll + 1 + (ll 
			- 1) * 5 - 6];
		alfa[l - 1] = -(t[ll + (ll - 1) * 5 - 6] * t[ll + ll * 5 - 6] 
			+ t[ll + 1 + (ll - 1) * 5 - 6] * t[ll + 1 + ll * 5 - 
			6]);
		if ((d__1 = t[ll + (ll - 1) * 5 - 6], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		    dphi = atan(t[ll + 1 + (ll - 1) * 5 - 6] / t[ll + (ll - 1)
			     * 5 - 6]) - phibf[l - 1];
		} else {
		    dphi = -phibf[l - 1];
		}
		if (-dphi > 1e-17) {
		    dphi += kons_ .pi;
		}
 
		phi[l - 1] += dphi / pie;
	    }
L130:
	    ;
	}
	goto L450;
 
L140:
	ix += -300;
	qu = 0.;
	qv = 0.;
	dyy1 = 0.;
	dyy2 = 0.;
	kpz = ell_ .kp[ix - 1];
	if (kpz == 6) {
	    goto L450;
	}
	kzz = ell_ .kz[ix - 1];
	kpv = qmodi_ .kpa[ix - 1];
	if (kpv != 1) {
	    goto L150;
	}
	qxsa = phi[0];
L150:
	if (kpv != 2 || ikpv == 1) {
	    goto L160;
	}
	qxse = phi[0];
	qwc[3] = qxse - qxsa;
	ikpv = 1;
L160:
	if (kzz == 0) {
	    goto L450;
	}
	dyy1 = 0.;
	dyy2 = 0.;
	if (rand0_ .iorg < 0) {
	    rand0_ .mzu[k - 1] = izu;
	}
	izu = rand0_ .mzu[k - 1] + 1;
	ekk = (ell_ .sm[ix - 1] + rand0_ .zfz[izu - 1] * ell_ .ek[ix - 1]) / (
		*dpp + 1.);
	++izu;
	xs = pla_ .xpl[ix - 1] + rand0_ .zfz[izu - 1] * pla_ .xrms[ix - 1];
	++izu;
	zs = pla_ .zpl[ix - 1] + rand0_ .zfz[izu - 1] * pla_ .zrms[ix - 1];
	xl = (t[0] - xs) * rand1_ .tiltc[k - 1] + (t[10] - zs) * 
		rand1_ .tilts[k - 1];
	zl = -(t[0] - xs) * rand1_ .tilts[k - 1] + (t[10] - zs) * 
		rand1_ .tiltc[k - 1];
	crkve = xl;
	cikve = zl;
	if (kzz < 0) {
	    goto L310;
	}
	switch ((int)kzz) {
	    case 1:  goto L170;
	    case 2:  goto L180;
	    case 3:  goto L190;
	    case 4:  goto L200;
	    case 5:  goto L210;
	    case 6:  goto L220;
	    case 7:  goto L230;
	    case 8:  goto L240;
	    case 9:  goto L250;
	    case 10:  goto L260;
	    case 11:  goto L270;
	}
	goto L450;
 
L170:
	ekk *= 1e3;
	dyy1 = ekk * rand1_ .tiltc[k - 1];
	dyy2 = ekk * rand1_ .tilts[k - 1];
	qu = 0.;
	qv = 0.;
	goto L420;
 
L180:
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cikve + rand1_ .tilts[k - 1] * 
		crkve);
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * tiltck;
	qv = -ekk * tiltsk;
	goto L420;
 
L190:
	ekk *= .001;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 2. * (tiltck * crkve + tiltsk * cikve);
	qv = ekk * 2. * (tiltck * cikve - tiltsk * crkve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cikve + rand1_ .tilts[k - 1] * 
		crkve);
	goto L420;
 
L200:
	ekk *= 1e-6;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 3. * (tiltck * crkve + tiltsk * cikve);
	qv = ekk * 3. * (tiltck * cikve - tiltsk * crkve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cikve + rand1_ .tilts[k - 1] * 
		crkve);
	goto L420;
 
L210:
	ekk *= 1e-9;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 4. * (tiltck * crkve + tiltsk * cikve);
	qv = ekk * 4. * (tiltck * cikve - tiltsk * crkve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cikve + rand1_ .tilts[k - 1] * 
		crkve);
	goto L420;
 
L220:
	ekk *= 1e-12;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 5 * (tiltck * crkve + tiltsk * cikve);
	qv = ekk * 5 * (tiltck * cikve - tiltsk * crkve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cikve + rand1_ .tilts[k - 1] * 
		crkve);
	goto L420;
 
L230:
	ekk *= 1e-15;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 6 * (tiltck * crkve + tiltsk * cikve);
	qv = ekk * 6 * (tiltck * cikve - tiltsk * crkve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cikve + rand1_ .tilts[k - 1] * 
		crkve);
	goto L420;
 
L240:
	ekk *= 1e-18;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 7 * (tiltck * crkve + tiltsk * cikve);
	qv = ekk * 7 * (tiltck * cikve - tiltsk * crkve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cikve + rand1_ .tilts[k - 1] * 
		crkve);
	goto L420;
 
L250:
	ekk *= 1e-21;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 8 * (tiltck * crkve + tiltsk * cikve);
	qv = ekk * 8 * (tiltck * cikve - tiltsk * crkve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cikve + rand1_ .tilts[k - 1] * 
		crkve);
	goto L420;
 
L260:
	ekk *= 1e-24;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 9 * (tiltck * crkve + tiltsk * cikve);
	qv = ekk * 9 * (tiltck * cikve - tiltsk * crkve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cikve + rand1_ .tilts[k - 1] * 
		crkve);
	goto L420;
L270:
	r0 = ell_ .ek[ix - 1];
	if ((d__1 = dkic_ .dki[ix - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
	    if ((d__1 = dkic_ .dki[ix + 1399], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		qu = - dkic_ .dki[ix - 1] / dkic_ .dki[ix + 1399] * dkic_ .dki[
			ix - 1] / (*dpp + 1.);
		dppi = dkic_ .dki[ix - 1] * 1e3 / (*dpp + 1.);
		t[5] = t[5] + (qu * xl - dppi * *dpp) * rand1_ .tiltc[k - 1] 
			+ dppi * (1. - rand1_ .tiltc[k - 1]);
		t[15] = t[15] + (qu * xl - dppi * *dpp) * rand1_ .tilts[k - 1]
			 + dppi * rand1_ .tilts[k - 1];
		i__2 = ium;
		for (i__ = 2; i__ <= i__2; ++i__) {
		    t[i__ + 4] += qu * t[i__ - 1] * rand1_ .tiltc[k - 1];
		    t[i__ + 14] += qu * t[i__ + 9] * rand1_ .tilts[k - 1];
 
		}
	    } else {
		dppi = dkic_ .dki[ix - 1] * 1e3 / (*dpp + 1.);
		t[5] = t[5] - dppi * *dpp * rand1_ .tiltc[k - 1] + dppi * (1. 
			- rand1_ .tiltc[k - 1]);
		t[15] = t[15] - dppi * *dpp * rand1_ .tilts[k - 1] + dppi * 
			rand1_ .tilts[k - 1];
	    }
	}
	if ((d__1 = dkic_ .dki[ix + 699], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
	    if ((d__1 = dkic_ .dki[ix + 1399], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		qu = dkic_ .dki[ix + 699] / dkic_ .dki[ix + 1399] * 
			dkic_ .dki[ix + 699] / (*dpp + 1.);
		dppi = dkic_ .dki[ix + 699] * 1e3 / (*dpp + 1.);
		t[5] = t[5] + (qu * zl - dppi * *dpp) * rand1_ .tilts[k - 1] 
			+ dppi * rand1_ .tilts[k - 1];
		t[15] = t[15] + (-qu * zl + dppi * *dpp) * rand1_ .tiltc[k - 
			1] - dppi * (1. - rand1_ .tiltc[k - 1]);
		i__2 = ium;
		for (i__ = 2; i__ <= i__2; ++i__) {
		    t[i__ + 4] += qu * t[i__ - 1] * rand1_ .tilts[k - 1];
		    t[i__ + 14] -= qu * t[i__ + 9] * rand1_ .tiltc[k - 1];
 
		}
	    } else {
		dppi = dkic_ .dki[ix + 699] * 1e3 / (*dpp + 1.);
		t[5] = t[5] - dppi * *dpp * rand1_ .tilts[k - 1] + dppi * 
			rand1_ .tilts[k - 1];
		t[15] = t[15] + dppi * *dpp * rand1_ .tiltc[k - 1] - dppi * (
			1. - rand1_ .tiltc[k - 1]);
	    }
	}
	if ((( r0 ) >= 0 ? ( r0 ) : -( r0 ))  <= 1e-17) {
	    goto L450;
	}
	nmz = mult1_ .nmu[ix - 1];
	if (nmz == 0) {
	    izu += 22;
	    goto L450;
	}
	im = mult1_ .irm[ix - 1];
	r0a = 1.;
	benkr = ell_ .ed[ix - 1] / (*dpp + 1.);
	i__2 = nmz;
	for (l = 1; l <= i__2; ++l) {
	    ++izu;
	    aa[l - 1] = multi_ .ak0[im + l * 700 - 701] + rand0_ .zfz[izu - 1]
		     * multi_ .aka[im + l * 700 - 701];
	    aa[l - 1] = benkr * aa[l - 1] / r0a;
	    ++izu;
	    bb[l - 1] = multi_ .bk0[im + l * 700 - 701] + rand0_ .zfz[izu - 1]
		     * multi_ .bka[im + l * 700 - 701];
	    bb[l - 1] = benkr * bb[l - 1] / r0a;
	    r0a *= r0;
 
	}
	if (nmz >= 2) {
	    qu = bb[1];
	    qv = -aa[1];
	    dyy1 = bb[0] + bb[1] * crkve + aa[1] * cikve;
	    dyy2 = aa[0] - bb[1] * cikve + aa[1] * crkve;
	    i__2 = nmz;
	    for (l = 3; l <= i__2; ++l) {
		l1 = l - 1;
		qu += l1 * (bb[l - 1] * crkve + aa[l - 1] * cikve);
		qv += l1 * (bb[l - 1] * cikve - aa[l - 1] * crkve);
		crkveuk = crkve * xl - cikve * zl;
		cikve = crkve * zl + cikve * xl;
		crkve = crkveuk;
		dyy1 = dyy1 + bb[l - 1] * crkve + aa[l - 1] * cikve;
		dyy2 = dyy2 - bb[l - 1] * cikve + aa[l - 1] * crkve;
 
	    }
	} else {
	    qu = 0.;
	    qv = 0.;
	    dyy1 = bb[0];
	    dyy2 = aa[0];
	}
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu1 = tiltck * qu - tiltsk * qv;
	qv = tiltck * qv + tiltsk * qu;
	qu = qu1;
	dyy11 = rand1_ .tiltc[k - 1] * dyy1 - rand1_ .tilts[k - 1] * dyy2;
	dyy2 = rand1_ .tiltc[k - 1] * dyy2 + rand1_ .tilts[k - 1] * dyy1;
	dyy1 = dyy11;
	izu = izu + 22 - (nmz << 1);
	goto L420;
 
L310:
	kzz = -kzz;
	switch ((int)kzz) {
	    case 1:  goto L320;
	    case 2:  goto L330;
	    case 3:  goto L340;
	    case 4:  goto L350;
	    case 5:  goto L360;
	    case 6:  goto L370;
	    case 7:  goto L380;
	    case 8:  goto L390;
	    case 9:  goto L400;
	    case 10:  goto L410;
	}
	goto L450;
 
L320:
	ekk *= 1e3;
	dyy1 = -ekk * rand1_ .tilts[k - 1];
	dyy2 = ekk * rand1_ .tiltc[k - 1];
	qu = 0.;
	qv = 0.;
	goto L420;
 
L330:
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cikve - rand1_ .tilts[k - 1] * 
		crkve);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = -ekk * tiltsk;
	qv = -ekk * tiltck;
	goto L420;
 
L340:
	ekk *= .001;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 2. * (tiltck * cikve - tiltsk * crkve);
	qv = -ekk * 2. * (tiltck * crkve + tiltsk * cikve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cikve - rand1_ .tilts[k - 1] * 
		crkve);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	goto L420;
 
L350:
	ekk *= 1e-6;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 3. * (tiltck * cikve - tiltsk * crkve);
	qv = ekk * -3. * (tiltck * crkve + tiltsk * cikve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cikve - rand1_ .tilts[k - 1] * 
		crkve);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	goto L420;
 
L360:
	ekk *= 1e-9;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 4. * (tiltck * cikve - tiltsk * crkve);
	qv = ekk * -4. * (tiltck * crkve + tiltsk * cikve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cikve - rand1_ .tilts[k - 1] * 
		crkve);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	goto L420;
 
L370:
	ekk *= 1e-12;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 5 * (tiltck * cikve - tiltsk * crkve);
	qv = ekk * -5 * (tiltck * crkve + tiltsk * cikve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cikve - rand1_ .tilts[k - 1] * 
		crkve);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	goto L420;
 
L380:
	ekk *= 1e-15;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 6 * (tiltck * cikve - tiltsk * crkve);
	qv = ekk * -6 * (tiltck * crkve + tiltsk * cikve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cikve - rand1_ .tilts[k - 1] * 
		crkve);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	goto L420;
 
L390:
	ekk *= 1e-18;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 7 * (tiltck * cikve - tiltsk * crkve);
	qv = ekk * -7 * (tiltck * crkve + tiltsk * cikve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cikve - rand1_ .tilts[k - 1] * 
		crkve);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	goto L420;
 
L400:
	ekk *= 1e-21;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 8 * (tiltck * cikve - tiltsk * crkve);
	qv = ekk * -8 * (tiltck * crkve + tiltsk * cikve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cikve - rand1_ .tilts[k - 1] * 
		crkve);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
	goto L420;
 
L410:
	ekk *= 1e-24;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 9 * (tiltck * cikve - tiltsk * crkve);
	qv = ekk * -9 * (tiltck * crkve + tiltsk * cikve);
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cikve - rand1_ .tilts[k - 1] * 
		crkve);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * crkve + rand1_ .tilts[k - 1] * 
		cikve);
L420:
	t[5] += dyy1;
	t[15] += dyy2;
	i__2 = ium;
	for (i__ = 2; i__ <= i__2; ++i__) {
	    t[i__ + 4] = t[i__ + 4] + qu * t[i__ - 1] - qv * t[i__ + 9];
	    t[i__ + 14] = t[i__ + 14] - qu * t[i__ + 9] - qv * t[i__ - 1];
 
	}
	for (l = 1; l <= 2; ++l) {
	    ll = l << 1;
 
	    alfa[l - 1] = -(t[ll + (ll - 1) * 5 - 6] * t[ll + ll * 5 - 6] + t[
		    ll + 1 + (ll - 1) * 5 - 6] * t[ll + 1 + ll * 5 - 6]);
	}
L450:
	;
    }
    qwc[1] = phi[0];
    qwc[2] = phi[1];
 

    return 0;
}  

 
 
  int postpr_(nfile)
integer *nfile;
{
     
    static char fmt_10320[] = "(//10x,\002** ERROR ** ----- INPUT DATA CORRUPTED\002,\002 (FILE : \002,i2,\002) -----\002//)";
    static char fmt_10010[] = "(f10.6)";
    static char fmt_10040[] = "(//131(\002-\002)//10x,\002OOOOOOOOOOOOOOOOOOOOOO\002/10x,\002OO                  OO\002/10x,\002OO  POSTPROCESSING  OO\002/10x,\002OO                  OO\002/10x,\002OOOOOOOOOOOOOOOOOOOOOO\002///10x,\002TITLE AND COMMENT :\002//a80//a80//)";
    static char fmt_10050[] = "(10x,\002THE FOLLOWING PARAMETERS ARE USED:\002//10x,\002PROGRAM NAME\002,t102,a8/10x,\002PARTICLE NUMBER\002,t102,i3/10x,\002TOTAL NUMBER OF PARTICLES\002,t102,i3/10x,\002PHASE SPACE\002,t102,a11/10x,\002MAXIMUM NUMBER OF TURNS\002,t102,i8/10x,\002HORIZONTAL BETA\002,t102,f16.10/10x,\002HORIZONTAL BETA-II\002,t102,f16.10/10x,\002HORIZONTAL BETA-III\002,t102,f16.10/10x,\002VERTICAL BETA\002,t102,f16.10/10x,\002VERTICAL BETA-II\002,t102,f16.10/10x,\002VERTICAL BETA-III\002,t102,f16.10/10x,\002LONGITUDINAL BETA\002,t98,f20.10/10x,\002LONGITUDINAL BETA-II\002,t102,f16.10/10x,\002LONGITUDINAL BETA-III\002,t102,f16.10/10x,\002HORIZONTAL ALFA\002,t102,f16.10/10x,\002HORIZONTAL ALFA-II\002,t102,f16.10/10x,\002HORIZONTAL ALFA-III\002,t102,f16.10)";
    static char fmt_10060[] = "(10x,\002VERTICAL ALFA\002,t102,f16.10/10x,\002VERTICAL ALFA-II\002,t102,f16.10/10x,\002VERTICAL ALFA-III\002,t102,f16.10/10x,\002LONGITUDINAL ALFA\002,t102,f16.10/10x,\002LONGITUDINAL ALFA-II\002,t102,f16.10/10x,\002LONGITUDINAL ALFA-III\002,t102,f16.10/10x,\002HORIZONTAL GAMMA\002,t102,f16.10/10x,\002HORIZONTAL GAMMA-II\002,t102,f16.10/10x,\002HORIZONTAL GAMMA-III\002,t102,f16.10/10x,\002VERTICAL GAMMA\002,t102,f16.10/10x,\002VERTICAL GAMMA-II\002,t102,f16.10/10x,\002VERTICAL GAMMA-III\002,t102,f16.10/10x,\002LONGITUDINAL GAMMA\002,t102,f16.10/10x,\002LONGITUDINAL GAMMA-II\002,t102,f16.10/10x,\002LONGITUDINAL GAMMA-III\002,t102,f16.10)";
    static char fmt_10061[] = "(10x,\002HORIZONTAL CLOSED ORBIT\002,t102,d16.10/10x,\002VERTICAL CLOSED ORBIT\002,t102,d16.10/10x,\002LONGITUDINAL CLOSED ORBIT\002,t102,d16.10/10x,\002SLOPE OF HORIZONTAL CLOSED ORBIT\002,t102,d16.10/10x,\002SLOPE OF VERTICAL CLOSED ORBIT\002,t102,d16.10/10x,\002SLOPE OF LONGITUDINAL CLOSED ORBIT\002,t102,d16.10/10x,\002HORIZONTAL DISPERSION\002,t102,f16.10/10x,\002VERTICAL DISPERSION\002,t102,f16.10/10x,\002SLOPE OF HORIZONTAL DISPERSION\002,t102,f16.10/10x,\002SLOPE OF VERTICAL DISPERSION\002,t102,f16.10/10x,\002LINEAR HORIZONTAL TUNE\002,t102,f16.10/10x,\002LINEAR VERTICAL TUNE\002,t102,f16.10/10x,\002LINEAR LONGITUDINAL TUNE\002,t102,f16.10)";
    static char fmt_10070[] = "(10x,\002DATA IS AVERAGED IN SAMPLES OF IAV TURNS\002,t96,\002IAV =    \002,i7/10x,\002START TURN NUMBER FOR THE ANALYSIS \002,t93,\002NSTART =  \002,i9/10x,\002THE ANALYSIS STOPS AFTER TURN NUMBER \002,t94,\002NSTOP =  \002,i9,/10x,\002HORIZONTAL ANGLE-INTERVAL FOR STROBOSCOPING THE VERTICAL\002,\002 PHASESPACE PROJECTION\002,t94,\002DPHIX = \002,d16.10/10x,\002VERTICAL ANGLE-INTERVAL FOR STROBOSCOPING THE HORIZONTAL\002,\002 PHASESPACE PROJECTION\002,t94,\002DPHIZ = \002,d16.10/10x,\002SWITCH FOR THE WEIGHTING OF THE LINEAR FIT FOR THE \002,\002DISTANCE IN PHASESPACE \002,t96,\002IWG = \002,i4/10x,\002INTEGER PART FOR THE HORIZONTAL TUNE \002,t96,\002QX0 = \002,f16.10/10x,\002INTEGER PART FOR THE VERTICAL TUNE \002,t96,\002QZ0 = \002,f16.10)";
    static char fmt_10080[] = "(10x,\002SWITCH FOR THE QX-VALUE CLOSE TO AN HALF-INTEGER\002,\002 ( INT => 1 ; HALF-INT => 0 )\002,t95,\002IVOX = \002,i4/10x,\002SWITCH FOR THE QZ-VALUE CLOSE TO AN HALF-INTEGER\002,\002 ( INT => 1 ; HALF-INT => 0 )\002,t95,\002IVOZ = \002,i4/10x,\002Q-VALUES ARE CHECKED FOR RESONANCES UP TO ORDER\002,t95,\002IRES = \002,i4/10x,\002A RESONANCE IS CONSIDERED TO BE STRONG WHEN THE Q-VALUES\002,\002 ARE CLOSER TO IT THAN\002,t95,\002DRES = \002,d16.10/10x,\002SWITCH FOR FFT-RANGE ( IFH=0 => 0-1 ; IFH=1 => 0-.5 \002,\002; IFH=2 => .5-1 )\002,t96,\002IFH = \002,i4/10x,\002Q-PEAKS OF THE FFT ARE CONSIDERED IF THEY ARE LARGER THAN\002,t95,\002DFFT = \002,d16.10)";
    static char fmt_10090[] = "(10x,\002TERMINAL TYPE\002,t93,\002KWTYPE = \002,i4/10x,\002SWITCH FOR PLOT ON TERMINAL (T) AND/OR GKSFILE (F)\002,\002 ( F => -1 ; T => 0 ; F+T => 1)\002,t96,\002ITF = \002,i4/10x,\002SWITCH TO STOP AFTER PLOTTING\002,\002 ( ICR = 0 => NO STOP ; ICR = 1 => STOP )\002,t96,\002ICR = \002,i4/10x,\002SWITCH FOR PRINTING THE DISTANCE IN PHASE SPACE\002,t95,\002IDIS = \002,i4/10x,\002SWITCH FOR PRINTING THE COORDINATES\002,t95,\002ICOW = \002,i4/10x,\002SWITCH FOR PRINTING THE STROBOSCOPED PHASESPACES\002,t95,\002ISTW = \002,i4/10x,\002SWITCH FOR PRINTING THE FFT-SIGNALS\002,t95,\002IFFW = \002,i4,i4)";
    static char fmt_10100[] = "(10x,\002EVERY ISKIP VALUE IS USED FOR THE ANALYSIS\002,t94,\002ISKIP = \002,i4/10x,\002SWITCH OF COURANT SYNDER TRANSFORMATION (ICONV = 1 => OFF)\002,t93,\002 ICONV = \002,i4/10x,\002SWITCH FOR READING MAD DATA ( IMAD = 1 => MAD-DATA \002,\002WITH LYAPUNOV ANALYSIS )\002,t95,\002IMAD = \002,i4/10x,\002SCALING OF MOMENTUM\002,\002 WITH LYAPUNOV ANALYSIS\002,t95,\002CMA1 = \002,f16.10/10x,\002SCALING OF PATH-LENGTH\002,\002 WITH LYAPUNOV ANALYSIS\002,t95,\002CMA2 = \002,f16.10/10x,\002SWITCH FOR PRINTING OF THE POSTPROCESSING OUTPUT\002,\002 NPRINT = ( 0 => OFF ; 1 => ON) \002,t93,\002NPRINT = \002,i4/10x,\002NUMBER OF BINARY FILES TO BE PROCESSED\002,\002 ( 90 - [90-NDAFI+1] )\002,t94,\002NDAFI = \002,i4//)";
    static char fmt_10290[] = "(//10x,\002** ERROR ** ----- TRANSFORMATION MATRIX SINGULAR \002,\002(FILE : \002,i2,\002) -----\002//)";
    static char fmt_10000[] = "(d10.4)";
    static char fmt_10310[] = "(//10x,\002** ERROR ** ----- WEIGHTING OF DISTANCE IN PHASE\002,\002 SPACE (FILE : \002,i2,\002) NOT POSSIBLE-----\002//)";
    static char fmt_10110[] = "(/10x,\002ANALYSING THE INCREASE OF THE DISTANCE IN PHASE-\002,\002SPACE\002/10x,53(\002-\002)///12x,\002TURNS\002,10x,\002DISTANCE\002,13x,\002SLOPE          RESIDUAL\002/10x,63(\002-\002))";
    static char fmt_10120[] = "(10x,i7,6x,d16.10,2(2x,f15.10))";
    static char fmt_10130[] = "(10x,63(\002-\002)//)";
    static char fmt_10140[] = "(//10x,\002AVERAGED PHASE-ADVANCE\002/10x,22(\002-\002)//10x,\002X-PHASE :  \002,f14.10,\002   +/_ \002,f14.10/10x,\002Z-PHASE :  \002,f14.10,\002   +/_ \002,f14.10//10x,\002S-PHASE :  \002,f14.10,\002   +/_ \002,f14.10//10x,\002START-QX : \002,f14.10,\002   CHANGE IN X : \002,d16.10/10x,\002START-QZ : \002,f14.10,\002   CHANGE IN Z : \002,d16.10/10x,\002START-QS : \002,f14.10,\002   CHANGE IN S : \002,d16.10///10x,\002THE AVERAGED PHASE-ADVANCES ARE CLOSER THEN \002,d10.4,\002 TO \002,\002THE FOLLOWING RESONANCES UP TO \002,i3,\002 ORDER\002/10x,98(\002-\002)//10x,\002NX * QX   +   NZ * QZ   -      P      =      DELTA\002/10x,52(\002-\002))";
    static char fmt_10170[] = "(12x,i2,11x,i3,7x,f8.1,9x,d10.4)";
    static char fmt_10150[] = "(/10x,\002WARNING ! X-PHASE MIGHT NOT BE PRECISE\002/)";
    static char fmt_10160[] = "(/10x,\002WARNING ! Z-PHASE MIGHT NOT BE PRECISE\002//)";
    static char fmt_10180[] = "(//10x,\002Q-VALUES FROM FFT-ROUTINE\002/10x,25(\002-\002)//10x,\002THE ANALYSIS WAS DONE WITH \002,i7,\002 ENTRIES.\002//10x,\002THE FOLLOWING Q-PEAKS ARE LARGER THEN \002,f8.4,\002 PERCENT.\002//10x,\002PLANE          Q-VALUE            SIZE [%]\002/10x,43(\002-\002))";
    static char fmt_10190[] = "(12x,\002X\002,7x,f14.10,5x,f14.10)";
    static char fmt_10200[] = "(12x,\002Z\002,7x,f14.10,5x,f14.10)";
    static char fmt_10210[] = "(//10x,\002MAXIMUM PEAK\002//10x,\002HORIZONTAL PLANE :  \002,f14.10/10x,\002VERTICAL PLANE   :  \002,f14.10//10x,\002START-QX : \002,f14.10,\002   CHANGE IN X : \002,d16.10/10x,\002START-QZ : \002,f14.10,\002   CHANGE IN Z : \002,d16.10///10x,\002THE MAXIMUM Q-PEAKS ARE CLOSER THEN \002,d10.4,\002 TO \002,\002THE FOLLOWING RESONANCES UP TO \002,i3,\002 ORDER\002/10x,96(\002-\002)//10x,\002NX * QX   +   NZ * QZ   -      P      =      DELTA\002/10x,52(\002-\002))";
    static char fmt_10270[] = "(////10x,\002LINEARLY DECOUPLED INVARIANTS\002/10x,35(\002-\002)/10x,\002INITIAL EMITTANCE MODE I   :\002,f16.10/10x,\002INITIAL EMITTANCE MODE II  :\002,f16.10/10x,\002INITIAL EMITTANCE MODE III :\002,f16.10/10x,\002INITIAL ANGLE     MODE I   :\002,f16.10/10x,\002INITIAL ANGLE     MODE II  :\002,f16.10/10x,\002INITIAL ANGLE     MODE III :\002,f16.10//10x,35(\002-\002)//14x,\002PLANE\002,10x,\002EMITTANCE\002,14x,\0024D-SMEAR\002,11x,\002MAXIMUM\002,11x,\002MINIMUM\002/28x,\002[PI*MM*MRAD]\002,15x,\002[%]\002,15x,\002[%]\002,15x,\002[%]\002/10x,86(\002-\002)/10x,\002HORIZONTAL\002,6x,f16.10,3(6x,f12.6)/10x,\002VERTICAL\002,8x,f16.10,3(6x,f12.6)/10x,\002SUM\002,13x,f16.10,3(6x,f12.6)/10x,86(\002-\002)//)";
    static char fmt_10220[] = "(////10x,\002CALCULATION OF THE AVERAGED EMITTANCES\002/10x,38(\002-\002)//24x,\002START-EMITTANCE           START-AMPLITUDE\002//10x,\002HORIZONTAL   \002,f16.10,9x,f16.10/10x,\002VERTICAL     \002,f16.10,9x,f16.10//14x,\002PLANE\002,10x,\002EMITTANCE\002,16x,\002SMEAR\002,12x,\002MAXIMUM\002,11x,\002MINIMUM\002/28x,\002[PI*MM*MRAD]\002,15x,\002[%]\002,15x,\002[%]\002,15x,\002[%]\002/10x,86(\002-\002)/10x,\002HORIZONTAL\002,6x,f16.10,3(6x,f12.6)/10x,\002VERTICAL\002,8x,f16.10,3(6x,f12.6)/10x,\002SUM\002,13x,f16.10,3(6x,f12.6)/10x,86(\002-\002)//)";
    static char fmt_10230[] = "(//10x,\002INVARIANTS OF THE 4-DIMENSIONAL PHASE-SPACE\002/10x,43(\002-\002)//)";
    static char fmt_10240[] = "(/10x,\002WARNING ! CALCULATION OF THE HORIZONTAL INVARIANT\002,\002 MIGHT NOT BE PRECISE\002/10x,\002ONLY \002,i5,\002 ENTRIES COMPARED TO \002,i5,\002 ANGLE-INTERVALS !\002/10x,\002INCREASE THE VERTICAL ANGLE-INT\002,\002ERVAL <DPHIZ>\002/)";
    static char fmt_10250[] = "(/10x,\002WARNING ! CALCULATION OF THE VERTICAL INVARIANT\002,\002 MIGHT NOT BE PRECISE\002/10x,\002ONLY \002,i5,\002 ENTRIES COMPARED TO \002,i5,\002 ANGLE-INTERVALS !\002/10x,\002INCREASE THE HORIZONTAL ANGLE-INT\002,\002ERVAL <DPHIX>\002/)";
    static char fmt_10260[] = "(/10x,\002THERE ARE \002,i5,\002 ENTRIES FOR THE CALCULATION OF\002,\002 THE HORIZONTAL INVARIANT GROUPED IN \002,i5,\002 ANGLE-INTERVALS\002/10x,\002--------- \002,i5,\002 ENTRIES ----------------------\002,\002---- VERTICAL   -------------------- \002,i5,\002 ANGLE-INTERVALS\002//10x,\002IF THE MOTION IS CLOSE TO FIXPOINTS THE NUMBER OF THOSE\002,\002 ANGLE-INTERVALS WILL BE ONLY A SMALL FRACTION\002/10x,\002OF THE TOTAL NUMBER OF \002,i5,\002 INTERVALS.\002//25x,\002PERCENTAGE OF OCCUPIED INTERVALS     NUMBER OF ENTRIES \002,\002PER OCCUPIED INTERVAL\002/10x,\002HORIZONTAL\002,16x,f10.6,30x,f12.6/10x,\002VERTICAL  \002,16x,f10.6,30x,f12.6///10x,\002THE CALCULATED INVARIANTS ARE IN UNITS OF [PI*MM*MRAD]\002//10x,\002HORIZONTAL\002,10x,f16.10/10x,\002VERTICAL  \002,10x,f16.10//)";
    static char fmt_10030[] = "(2f10.6)";
    static char fmt_10300[] = "(//10x,\002** ERROR ** ----- FILE :\002,i2,\002 WITH TRACKING \002,\002DATA EMPTY OR CORRUPTED-----\002/10x,\002PROBLEM : \002,a80//)";

     
    integer i__1;
    doublereal d__1, d__2, d__3, d__4;
    alist al__1;

     
      int s_copy();
    integer f_rew(), s_rsue(), do_uio(), e_rsue(), s_wsfe(), do_fio(), e_wsfe(
	    ), s_cmp(), s_wsle(), do_lio(), e_wsle();
    double sqrt();
    integer s_wsfi(), e_wsfi();
    double atan(), atan2(), log();
    integer i_dnnt();
    double d_nint();
    integer pow_ii();
    double d_lg10();

     
    extern   int distance_();
    static doublereal b, c__, d__, e, f, g, h__;
    static integer i__, j, k;
    static doublereal p, t[36]	 , x[12]	 , b0, 
	    c0, c1, d1, e1, f1, g1, h1;
    static integer i1, i2;
    static doublereal d0, e0, f0, g0, h0, p1, c6;
    static integer i3, k1;
    static doublereal s6;
    static integer ia, i11, ii;
    static doublereal ta[36]	 ;
    static integer iq, jq;
    static doublereal cx, cz, xp, zp, sx, sz;
    static integer ia0;
    static doublereal di0[2];
    static integer if1, if2;
    static doublereal dp1;
    static integer im1, jm1;
    static doublereal qs0, xp0, zp0;
    static integer iaa;
    static doublereal dle[10000];
    static integer iab;
    static doublereal emi, di11;
    static integer ife;
    static doublereal clo[3];
    static integer ifp;
    static doublereal tle[10000], wgh[10000], emt, emx, qwc[3], emz, tpi, dpx,
	     tlo, evt;
    static char hvs[11];
    static doublereal fxs[20000], fzs[20000], evx, evz, dpz, xxi[20000], zzi[
	    20000];
    extern   int fft_();
    static doublereal xxr[20000], zzr[20000], bet0[3], alf0[3], dip0[2];
    static integer iap6;
    static doublereal dle1, dph6;
    static integer ife2;
    static doublereal ffx, tle1, ffz;
    extern   int ipl_();
    static doublereal emx0;
    static integer im1s;
    static doublereal emz0, sdp6;
    static integer jm1s;
    static doublereal evt1, tph6;
    static integer ivo6;
    static doublereal evx2, evx1, evz2, evz1, alf04[2], dife, emag, bet04[2], 
	    biav[10000], bold, prec, pmin[30], pmax[30], clop[3];
    static integer nfft, numl;
    static doublereal xinv[1000];
    static integer invx[1000];
    static doublereal zinv[1000];
    static integer invz[1000];
    static doublereal dnms;
    extern   int join_();
    static integer iapx, iapz, nivh;
    static doublereal di0au[4], finv, dle1c, dphx, dphz, tphx, tphz, sdpx, 
	    sdpz, sevx, sevz, sevt, txyz[6], emax, xyzv[6], emix, emaz, emiz, 
	    emig, emxa, emza;
    static integer iwar6;
    static doublereal dizu0, emta, emxs, emzs, emts;
    static integer nuex, nuez, nuix, nuiz;
    static doublereal xing, zing, pinx, pinz, pixr, pizr;
    extern   int dinv_();
    static doublereal emat, emit, emii, angi;
    static char cdate[8];
    static doublereal dmmac, dpxp;
    static integer ilapa;
    static doublereal alf0s2;
    static integer ifipa;
    static doublereal gam0s1, gam0s2, gam0s3, alf0x2, rbeta[6], gam0x1;
    static char ctime[8];
    static doublereal txyz2[6], cloau[6], xyzv2[6], bet0x2, bet0x3, sumda[60],
	     gam0x2, gam0x3;
    static integer itopa;
    static char title[80*20];
    static doublereal slope[10000];
    static integer ierro;
    static doublereal alf0x3, const__, bet0z2, bet0z3, gam0z1, gam0z2, dummy, 
	    gam0z3, alf0z2, alf0z3;
    static integer nlost, ntwin;
    static doublereal bet0s2, bet0s3, alf0s3;
    static integer iwarx, iwarz;
    static doublereal armin, tasum, emiii, angii, evxma, evzma, evtma, evxmi, 
	    evzmi, evtmi, dpzp;
    static integer iskc, idnt;
    extern   int lfitw_(), lfit_();
    static doublereal pieni2, armin0, evxm, evzm, evtm, tidnt;
    static integer ilyap, iturn;
    static doublereal ares, dares, ared, dared, xxmax, zzmax, xxmin, zzmin, 
	    xxaux, zzaux, ampx0, ampz0, pcha;
    extern   int hbook2_(), hplot_(), hplax_();
    static doublereal angiii;
    extern   int cphase_(), hdelet_(), caconv_();
    static doublereal varlea[10000];
    static char commen[80];
    extern   int cinvar_(), htitle_(), hplsof_(), iselnt_(), 
	    hplset_();
    static doublereal slopem, dnumlr, ratemx;
    static char chxtit[80*20], chytit[80*20];
    static doublereal ratemz;
    static char progrm[8];
    static integer nerror;
    extern   int hplopt_(), hplsiz_(), sinpro_();
    static integer rdummy[6];
    static char sixtit[80];

     
    static cilist io___3209 = { 1, 0, 1, 0, 0 };
    static cilist io___3224 = { 0, 6, 0, fmt_10320, 0 };
    static cilist io___3225 = { 1, 0, 1, 0, 0 };
    static cilist io___3226 = { 0, 6, 0, fmt_10320, 0 };
    static cilist io___3227 = { 1, 0, 1, 0, 0 };
    static cilist io___3229 = { 0, 6, 0, fmt_10320, 0 };
    static cilist io___3230 = { 1, 0, 1, 0, 0 };
    static cilist io___3232 = { 0, 6, 0, fmt_10320, 0 };
    static cilist io___3233 = { 0, 0, 0, 0, 0 };
    static cilist io___3255 = { 0, 6, 0, 0, 0 };
    static icilist io___3258 = { 0, posti3_ .toptit+93, 0, "(I3)", 3, 1 };
    static icilist io___3259 = { 0, posti3_ .toptit+110, 0, "(A11)", 11, 1 };
    static icilist io___3260 = { 0, posti3_ .toptit+245, 0, fmt_10010, 10, 1 }
	    ;
    static icilist io___3261 = { 0, posti3_ .toptit+262, 0, fmt_10010, 10, 1 }
	    ;
    static icilist io___3262 = { 0, posti3_ .toptit+278, 0, fmt_10010, 10, 1 }
	    ;
    static cilist io___3263 = { 0, 6, 0, fmt_10040, 0 };
    static cilist io___3264 = { 0, 6, 0, fmt_10050, 0 };
    static cilist io___3265 = { 0, 6, 0, fmt_10060, 0 };
    static cilist io___3266 = { 0, 6, 0, fmt_10061, 0 };
    static cilist io___3267 = { 0, 6, 0, fmt_10070, 0 };
    static cilist io___3268 = { 0, 6, 0, fmt_10080, 0 };
    static cilist io___3269 = { 0, 6, 0, fmt_10090, 0 };
    static cilist io___3270 = { 0, 6, 0, fmt_10100, 0 };
    static cilist io___3336 = { 0, 6, 0, fmt_10290, 0 };
    static cilist io___3337 = { 1, 0, 1, 0, 0 };
    static cilist io___3346 = { 1, 0, 1, 0, 0 };
    static cilist io___3354 = { 0, 6, 0, fmt_10320, 0 };
    static cilist io___3355 = { 1, 0, 1, 0, 0 };
    static cilist io___3356 = { 0, 6, 0, fmt_10320, 0 };
    static cilist io___3357 = { 1, 0, 1, 0, 0 };
    static cilist io___3358 = { 1, 0, 1, 0, 0 };
    static cilist io___3359 = { 0, 6, 0, fmt_10320, 0 };
    static icilist io___3361 = { 0, posti3_ .toptit+130, 0, fmt_10000, 10, 1 }
	    ;
    static cilist io___3362 = { 0, 6, 0, 0, 0 };
    static cilist io___3363 = { 0, 6, 0, 0, 0 };
    static cilist io___3364 = { 0, 6, 0, 0, 0 };
    static cilist io___3365 = { 0, 6, 0, 0, 0 };
    static cilist io___3366 = { 0, 6, 0, 0, 0 };
    static cilist io___3367 = { 0, 6, 0, 0, 0 };
    static cilist io___3368 = { 0, 6, 0, 0, 0 };
    static cilist io___3369 = { 0, 6, 0, 0, 0 };
    static cilist io___3382 = { 0, 6, 0, 0, 0 };
    static icilist io___3383 = { 0, posti3_ .toptit+165, 0, fmt_10010, 10, 1 }
	    ;
    static icilist io___3384 = { 0, posti3_ .toptit+182, 0, fmt_10010, 10, 1 }
	    ;
    static cilist io___3408 = { 1, 0, 1, 0, 0 };
    static cilist io___3409 = { 1, 0, 1, 0, 0 };
    static cilist io___3410 = { 0, 6, 0, fmt_10320, 0 };
    static cilist io___3424 = { 0, 6, 0, fmt_10310, 0 };
    static cilist io___3425 = { 0, 6, 0, 0, 0 };
    static cilist io___3426 = { 0, 6, 0, 0, 0 };
    static cilist io___3428 = { 0, 6, 0, 0, 0 };
    static cilist io___3432 = { 1, 0, 1, 0, 0 };
    static cilist io___3433 = { 0, 6, 0, fmt_10320, 0 };
    static cilist io___3434 = { 1, 0, 1, 0, 0 };
    static cilist io___3435 = { 0, 6, 0, fmt_10320, 0 };
    static cilist io___3437 = { 0, 6, 0, fmt_10110, 0 };
    static cilist io___3441 = { 0, 6, 0, fmt_10120, 0 };
    static cilist io___3442 = { 0, 6, 0, fmt_10130, 0 };
    static cilist io___3443 = { 0, 6, 0, fmt_10140, 0 };
    static cilist io___3452 = { 0, 6, 0, fmt_10170, 0 };
    static cilist io___3453 = { 0, 6, 0, fmt_10170, 0 };
    static cilist io___3454 = { 0, 6, 0, fmt_10150, 0 };
    static cilist io___3455 = { 0, 6, 0, fmt_10160, 0 };
    static cilist io___3457 = { 0, 6, 0, 0, 0 };
    static cilist io___3459 = { 0, 6, 0, fmt_10180, 0 };
    static cilist io___3467 = { 0, 6, 0, 0, 0 };
    static cilist io___3468 = { 0, 6, 0, 0, 0 };
    static cilist io___3473 = { 0, 6, 0, fmt_10190, 0 };
    static cilist io___3474 = { 0, 6, 0, fmt_10200, 0 };
    static cilist io___3475 = { 0, 6, 0, fmt_10210, 0 };
    static cilist io___3476 = { 0, 6, 0, fmt_10170, 0 };
    static cilist io___3477 = { 0, 6, 0, fmt_10170, 0 };
    static cilist io___3478 = { 0, 6, 0, fmt_10270, 0 };
    static cilist io___3481 = { 0, 6, 0, fmt_10220, 0 };
    static cilist io___3484 = { 1, 10, 0, 0, 0 };
    static cilist io___3485 = { 0, 6, 0, 0, 0 };
    static cilist io___3486 = { 0, 6, 0, 0, 0 };
    static cilist io___3487 = { 0, 6, 0, 0, 0 };
    static cilist io___3488 = { 0, 6, 0, 0, 0 };
    static cilist io___3489 = { 0, 6, 0, fmt_10230, 0 };
    static cilist io___3490 = { 0, 6, 0, fmt_10240, 0 };
    static cilist io___3491 = { 0, 6, 0, fmt_10250, 0 };
    static cilist io___3492 = { 0, 6, 0, fmt_10260, 0 };
    static cilist io___3495 = { 1, 0, 1, 0, 0 };
    static cilist io___3496 = { 0, 6, 0, fmt_10320, 0 };
    static cilist io___3497 = { 1, 0, 1, 0, 0 };
    static cilist io___3498 = { 1, 0, 1, 0, 0 };
    static cilist io___3499 = { 0, 6, 0, fmt_10320, 0 };
    static cilist io___3502 = { 0, 6, 0, 0, 0 };
    static cilist io___3503 = { 0, 6, 0, 0, 0 };
    static cilist io___3504 = { 1, 14, 0, fmt_10030, 0 };
    static cilist io___3505 = { 0, 6, 0, 0, 0 };
    static cilist io___3506 = { 0, 6, 0, 0, 0 };
    static cilist io___3507 = { 0, 6, 0, 0, 0 };
    static cilist io___3508 = { 0, 6, 0, 0, 0 };
    static cilist io___3509 = { 0, 6, 0, 0, 0 };
    static cilist io___3510 = { 0, 6, 0, 0, 0 };
    static cilist io___3511 = { 1, 15, 0, fmt_10030, 0 };
    static cilist io___3512 = { 0, 6, 0, 0, 0 };
    static cilist io___3513 = { 0, 6, 0, 0, 0 };
    static cilist io___3514 = { 0, 6, 0, 0, 0 };
    static cilist io___3515 = { 0, 6, 0, 0, 0 };
    static cilist io___3516 = { 0, 6, 0, fmt_10300, 0 };
    static cilist io___3517 = { 0, 6, 0, fmt_10300, 0 };
    static cilist io___3518 = { 0, 6, 0, fmt_10300, 0 };
    static cilist io___3519 = { 0, 6, 0, fmt_10300, 0 };
    static cilist io___3520 = { 1, 10, 0, 0, 0 };


 

 

 

 

 

 
    pieni2 = 1e-8;
    for (i__ = 1; i__ <= 20000; ++i__) {
	for (j = 1; j <= 3; ++j) {
	    (phase_._2) .phase[j + i__ * 3 - 4] = 0.;
 
	}
    }
    for (i__ = 1; i__ <= 2; ++i__) {
	bet04[i__ - 1] = 0.;
	alf04[i__ - 1] = 0.;
	di0[i__ - 1] = 0.;
	dip0[i__ - 1] = 0.;
	di0au[i__ - 1] = 0.;
	di0au[i__ + 1] = 0.;
 
    }
    for (i__ = 1; i__ <= 3; ++i__) {
	bet0[i__ - 1] = 0.;
	alf0[i__ - 1] = 0.;
	qwc[i__ - 1] = 0.;
	clo[i__ - 1] = 0.;
	clop[i__ - 1] = 0.;
 
    }
    for (i__ = 1; i__ <= 1000; ++i__) {
	invx[i__ - 1] = 0;
	invz[i__ - 1] = 0;
	xinv[i__ - 1] = 0.;
	zinv[i__ - 1] = 0.;
	invari_ .dani[i__ - 1] = 0.;
 
    }
    invari_ .dani[1000] = 0.;
    for (i__ = 1; i__ <= 20000; ++i__) {
	xxr[i__ - 1] = 0.;
	xxi[i__ - 1] = 0.;
	zzr[i__ - 1] = 0.;
	zzi[i__ - 1] = 0.;
	fxs[i__ - 1] = 0.;
	fzs[i__ - 1] = 0.;
 
    }
    for (i__ = 1; i__ <= 6; ++i__) {
	txyz[i__ - 1] = 0.;
	txyz2[i__ - 1] = 0.;
	xyzv[i__ - 1] = 0.;
	xyzv2[i__ - 1] = 0.;
	rbeta[i__ - 1] = 0.;
	cloau[i__ - 1] = 0.;
	x[(i__ << 1) - 2] = 0.;
	x[(i__ << 1) - 1] = 0.;
 
    }
    for (i__ = 1; i__ <= 6; ++i__) {
	for (j = 1; j <= 6; ++j) {
	    t[i__ + j * 6 - 7] = 0.;
	    ta[i__ + j * 6 - 7] = 0.;
 
	}
    }
    for (i__ = 1; i__ <= 30; ++i__) {
	pmax[i__ - 1] = 0.;
	pmin[i__ - 1] = 0.;
 
    }
    for (i__ = 1; i__ <= 20; ++i__) {
	s_copy(title + (i__ - 1) * 80, " ", 80L, 1L);
	s_copy(chxtit + (i__ - 1) * 80, " ", 80L, 1L);
	s_copy(chytit + (i__ - 1) * 80, " ", 80L, 1L);
 
    }
    for (i__ = 1; i__ <= 10000; ++i__) {
	tle[i__ - 1] = 0.;
	dle[i__ - 1] = 0.;
	slope[i__ - 1] = (float)0.;
	varlea[i__ - 1] = (float)0.;
	wgh[i__ - 1] = 0.;
	biav[i__ - 1] = 0.;
 
    }
    for (i__ = 1; i__ <= 60; ++i__) {
	sumda[i__ - 1] = 0.;
 
    }
    b0 = 0.;
    nlost = 0;
    ntwin = 1;
    nfft = 1;
    for (j = 1; j <= 20000; ++j) {
	if (nfft > 10000) {
	    goto L130;
	}
	nfft <<= 1;
 
    }
L130:
 

 
 

    al__1.aerr = 0;
    al__1.aunit = *nfile;
    f_rew(&al__1);
    ia = 0;
    io___3209.ciunit = *nfile;
    ierro = s_rsue(&io___3209);
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, sixtit, 80L);
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, commen, 80L);
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, cdate, 8L);
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, ctime, 8L);
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, progrm, 8L);
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ifipa, (ftnlen)sizeof(integer));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ilapa, (ftnlen)sizeof(integer));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&itopa, (ftnlen)sizeof(integer));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)& cor_ .icode, (ftnlen)sizeof(integer));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&numl, (ftnlen)sizeof(integer));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&qwc[0], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&qwc[1], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&qwc[2], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&clo[0], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&clop[0], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&clo[1], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&clop[1], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&clo[2], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&clop[2], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&di0[0], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&dip0[0], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&di0[1], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&dip0[1], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&dummy, (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&dummy, (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[0], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[6], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[12], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[18], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[24], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[30], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[1], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[7], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[13], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[19], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[25], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[31], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[2], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[8], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[14], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[20], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[26], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[32], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[3], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[9], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[15], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[21], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[27], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[33], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[4], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[10], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[16], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[22], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[28], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[34], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[5], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[11], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[17], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[23], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[29], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&ta[35], (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&dmmac, (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&dnms, (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&dizu0, (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)&dnumlr, (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)& cor_ .sigcor, (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = do_uio(&c__1, (char *)& cor_ .dpscor, (ftnlen)sizeof(doublereal));
    if (ierro != 0) {
	goto L100109;
    }
    ierro = e_rsue();
L100109:
    if (ierro < 0) {
	goto L510;
    }
    if (ierro > 0) {
	s_wsfe(&io___3224);
	do_fio(&c__1, (char *)&(*nfile), (ftnlen)sizeof(integer));
	e_wsfe();
	goto L550;
    }
    sumda[0] = (doublereal) numl;
    if (cor_ .icode == 1 || cor_ .icode == 2 || cor_ .icode == 4) {
	cor_ .idam = 1;
    }
    if (cor_ .icode == 3 || cor_ .icode == 5 || cor_ .icode == 6) {
	cor_ .idam = 2;
    }
    if (cor_ .icode == 7) {
	cor_ .idam = 3;
    }
    if (ilapa != ifipa) {
	ntwin = 2;
    }
    if (postr_ .imad == 1 && s_cmp(progrm, "MAD", 8L, 3L) == 0) {
	postr_ .imad = 0;
	al__1.aerr = 0;
	al__1.aunit = *nfile;
	f_rew(&al__1);
	join_();
	io___3225.ciunit = *nfile;
	ierro = s_rsue(&io___3225);
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, sixtit, 80L);
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, commen, 80L);
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, cdate, 8L);
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, ctime, 8L);
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, progrm, 8L);
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ifipa, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ilapa, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&itopa, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)& cor_ .icode, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&numl, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&qwc[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&qwc[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&qwc[2], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&clo[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&clop[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&clo[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&clop[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&clo[2], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&clop[2], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&di0[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&dip0[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&di0[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&dip0[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&dummy, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&dummy, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[0], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[6], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[12], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[18], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[24], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[30], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[1], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[7], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[13], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[19], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[25], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[31], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[2], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[8], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[14], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[20], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[26], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[32], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[3], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[9], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[15], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[21], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[27], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[33], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[4], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[10], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[16], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[22], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[28], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[34], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[5], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[11], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[17], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[23], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[29], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&ta[35], (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&dmmac, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&dnms, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&dizu0, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)&dnumlr, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)& cor_ .sigcor, (ftnlen)sizeof(
		doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = do_uio(&c__1, (char *)& cor_ .dpscor, (ftnlen)sizeof(
		doublereal));
	if (ierro != 0) {
	    goto L100110;
	}
	ierro = e_rsue();
L100110:
	if (ierro < 0) {
	    goto L520;
	}
	ta[30] *= 1e3;
	ta[31] *= 1e3;
	ta[32] *= 1e3;
	ta[33] *= 1e3;
	ta[34] *= 1e3;
	ta[5] *= .001;
	ta[11] *= .001;
	ta[17] *= .001;
	ta[23] *= .001;
	ta[29] *= .001;
	if (ierro > 0) {
	    s_wsfe(&io___3226);
	    do_fio(&c__1, (char *)&(*nfile), (ftnlen)sizeof(integer));
	    e_wsfe();
	    goto L550;
	}
    }
 
    io___3227.ciunit = *nfile;
    ierro = s_rsue(&io___3227);
    if (ierro != 0) {
	goto L100111;
    }
    ierro = do_uio(&c__1, (char *)&iaa, (ftnlen)sizeof(integer));
    if (ierro != 0) {
	goto L100111;
    }
    ierro = e_rsue();
L100111:
    if (ierro < 0) {
	goto L530;
    }
    if (ierro > 0) {
	s_wsfe(&io___3229);
	do_fio(&c__1, (char *)&(*nfile), (ftnlen)sizeof(integer));
	e_wsfe();
	goto L550;
    }
    io___3230.ciunit = *nfile;
    ierro = s_rsue(&io___3230);
    if (ierro != 0) {
	goto L100112;
    }
    ierro = do_uio(&c__1, (char *)&iab, (ftnlen)sizeof(integer));
    if (ierro != 0) {
	goto L100112;
    }
    ierro = e_rsue();
L100112:
    if (ierro < 0) {
	goto L600;
    }
    if (ierro > 0) {
	s_wsfe(&io___3232);
	do_fio(&c__1, (char *)&(*nfile), (ftnlen)sizeof(integer));
	e_wsfe();
	goto L550;
    }
L600:
    if ((numl + 1) / postr_ .iskip / (iab - iaa) / posti1_ .iav > 10000) {
	postr_ .nstop = posti1_ .iav * 10000;
    }
    al__1.aerr = 0;
    al__1.aunit = *nfile;
    f_rew(&al__1);
    io___3233.ciunit = *nfile;
    s_rsue(&io___3233);
    e_rsue();
    sumda[4] = ta[0] * ta[0] + ta[6] * ta[6];
    sumda[5] = ta[14] * ta[14] + ta[20] * ta[20];
    if (postr_ .iconv == 1) {
	postr_ .cma1 = 1.;
	postr_ .cma2 = 1.;
	clo[0] = 0.;
	clo[1] = 0.;
	clo[2] = 0.;
	clop[0] = 0.;
	clop[1] = 0.;
	clop[2] = 0.;
	di0[0] = 0.;
	di0[1] = 0.;
	dip0[0] = 0.;
	dip0[1] = 0.;
	for (i__ = 1; i__ <= 6; ++i__) {
	    for (j = 1; j <= 6; ++j) {
		if (i__ != j) {
		    ta[i__ + j * 6 - 7] = 0.;
		} else {
		    ta[i__ + j * 6 - 7] = 1.;
		}
 
	    }
	}
    }
    cloau[0] = clo[0];
    cloau[1] = clop[0];
    cloau[2] = clo[1];
    cloau[3] = clop[1];
    cloau[4] = clo[2];
    cloau[5] = clop[2];
    di0au[0] = di0[0];
    di0au[1] = dip0[0];
    di0au[2] = di0[1];
    di0au[3] = dip0[1];
    cor_ .sigcor = postr_ .cma2;
    cor_ .dpscor = postr_ .cma1;
    if (ifipa == ilapa && posti2_ .ndafi > itopa) {
	posti2_ .ndafi = itopa;
    }
    if (ilapa - ifipa == 1 && posti2_ .ndafi > itopa / 2) {
	posti2_ .ndafi = itopa / 2;
    }
 

 
 

    bet0[0] = ta[0] * ta[0] + ta[6] * ta[6];
    bet0x2 = ta[12] * ta[12] + ta[18] * ta[18];
    bet0x3 = ta[24] * ta[24] + ta[30] * ta[30];
    gam0x1 = ta[1] * ta[1] + ta[7] * ta[7];
    gam0x2 = ta[13] * ta[13] + ta[19] * ta[19];
    gam0x3 = ta[25] * ta[25] + ta[31] * ta[31];
    alf0[0] = -(ta[0] * ta[1] + ta[6] * ta[7]);
    alf0x2 = -(ta[12] * ta[13] + ta[18] * ta[19]);
    alf0x3 = -(ta[24] * ta[25] + ta[30] * ta[31]);
    bet0[1] = ta[14] * ta[14] + ta[20] * ta[20];
    bet0z2 = ta[2] * ta[2] + ta[8] * ta[8];
    bet0z3 = ta[26] * ta[26] + ta[32] * ta[32];
    gam0z1 = ta[15] * ta[15] + ta[21] * ta[21];
    gam0z2 = ta[3] * ta[3] + ta[9] * ta[9];
    gam0z3 = ta[27] * ta[27] + ta[33] * ta[33];
    alf0[1] = -(ta[14] * ta[15] + ta[20] * ta[21]);
    alf0z2 = -(ta[2] * ta[3] + ta[8] * ta[9]);
    alf0z3 = -(ta[26] * ta[27] + ta[32] * ta[33]);
    bet0[2] = ta[28] * ta[28] + ta[34] * ta[34];
    bet0s2 = ta[4] * ta[4] + ta[10] * ta[10];
    bet0s3 = ta[16] * ta[16] + ta[22] * ta[22];
    gam0s1 = ta[29] * ta[29] + ta[35] * ta[35];
    gam0s2 = ta[5] * ta[5] + ta[11] * ta[11];
    gam0s3 = ta[17] * ta[17] + ta[23] * ta[23];
    alf0[2] = -(ta[28] * ta[29] + ta[34] * ta[35]);
    alf0s2 = -(ta[4] * ta[5] + ta[10] * ta[11]);
    alf0s3 = -(ta[16] * ta[17] + ta[22] * ta[23]);
    bet04[0] = bet0[0];
    bet04[1] = bet0[1];
    alf04[0] = alf0[0];
    alf04[1] = alf0[1];
    if (bet0[0] <= 1e-17 || bet0[1] <= 1e-17) {
	s_wsle(&io___3255);
	do_lio(&c__9, &c__1, "WARNING: BETA VALUES ARE ZERO", 29L);
	e_wsle();
	bet0[0] = 0.;
	bet0[1] = 0.;
    }
    for (i__ = 1; i__ <= 3; ++i__) {
	ii = i__ << 1;
	rbeta[ii - 2] = sqrt(bet0[i__ - 1]);
	rbeta[ii - 1] = rbeta[ii - 2];
	if ((d__1 = rbeta[ii - 2], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) < 1e-17) {
	    rbeta[ii - 2] = 1.;
	}
	if ((d__1 = rbeta[ii - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) < 1e-17) {
	    rbeta[ii - 1] = 1.;
	}
 
    }
 

 
 

 
    if (cor_ .icode == 1) {
	s_copy(hvs, "Hor        ", 11L, 11L);
    }
    if (cor_ .icode == 2) {
	s_copy(hvs, "    Ver    ", 11L, 11L);
    }
    if (cor_ .icode == 3) {
	s_copy(hvs, "Hor Ver    ", 11L, 11L);
    }
    if (cor_ .icode == 4) {
	s_copy(hvs, "        Syn", 11L, 11L);
    }
    if (cor_ .icode == 5) {
	s_copy(hvs, "Hor     Syn", 11L, 11L);
    }
    if (cor_ .icode == 6) {
	s_copy(hvs, "    Ver Syn", 11L, 11L);
    }
    if (cor_ .icode == 7) {
	s_copy(hvs, "Hor Ver Syn", 11L, 11L);
    }
    s_copy(posti3_ .toptit + 80, "Particle no. ", 13L, 13L);
    s_wsfi(&io___3258);
    do_fio(&c__1, (char *)&ifipa, (ftnlen)sizeof(integer));
    e_wsfi();
    s_copy(posti3_ .toptit + 96, ", Phase Space ", 14L, 14L);
    s_wsfi(&io___3259);
    do_fio(&c__1, hvs, 11L);
    e_wsfi();
    s_copy(posti3_ .toptit + 121, ", Dp/p = ", 9L, 9L);
    s_copy(posti3_ .toptit + 140, " ", 20L, 1L);
    s_copy(posti3_ .toptit + 160, "Ax = ", 5L, 5L);
    s_copy(posti3_ .toptit + 175, ", Ay = ", 7L, 7L);
    s_copy(posti3_ .toptit + 192, " ", 48L, 1L);
    s_copy(posti3_ .toptit + 240, "Qx = ", 5L, 5L);
    s_wsfi(&io___3260);
    do_fio(&c__1, (char *)&qwc[0], (ftnlen)sizeof(doublereal));
    e_wsfi();
    s_copy(posti3_ .toptit + 255, ", Qy = ", 7L, 7L);
    s_wsfi(&io___3261);
    do_fio(&c__1, (char *)&qwc[1], (ftnlen)sizeof(doublereal));
    e_wsfi();
    s_copy(posti3_ .toptit + 272, ", Qs = ", 7L, 7L);
    s_wsfi(&io___3262);
    do_fio(&c__1, (char *)&qwc[2], (ftnlen)sizeof(doublereal));
    e_wsfi();
    s_copy(posti3_ .toptit + 288, " ", 32L, 1L);
    s_copy(title, "Normalized Distance of Phase Space D as a Function of Turn Number N", 80L, 67L);
    s_copy(title + 80, "Normalized Horizontal Phase Space Projection", 80L, 
	    44L);
    s_copy(title + 160, "Normalized Vertical Phase Space Projection", 80L, 
	    42L);
    s_copy(title + 240, "Physical Phase Space Projection", 80L, 31L);
    s_copy(title + 320, "Synchrotron Phase Space Projection", 80L, 34L);
    s_copy(title + 400, "Synchrotron versus Horizontal Phase Space Projection"
	    , 80L, 52L);
    s_copy(title + 480, "Synchrotron versus Vertical Phase Space Projection", 
	    80L, 50L);
    s_copy(title + 560, "Energy E as a Function of Turn Number N", 80L, 39L);
    s_copy(title + 640, "Stroboscoped Normalized Horizontal Phase Space Projection", 80L, 57L);
    s_copy(title + 720, "Stroboscoped Normalized Vertical Phase Space Projection", 80L, 55L);
    s_copy(title + 800, "FFT Analysis of the X Coordinate", 80L, 32L);
    s_copy(title + 880, "FFT Analysis of the Y Coordinate", 80L, 32L);
    s_copy(chxtit, "N", 80L, 1L);
    s_copy(chytit, "D (PI rad)", 80L, 10L);
    s_copy(chxtit + 80, "X (mm)", 80L, 6L);
    s_copy(chytit + 80, "Normalized Slope of X (mm)", 80L, 26L);
    s_copy(chxtit + 160, "Y (mm)", 80L, 6L);
    s_copy(chytit + 160, "Normalized Slope of Y (MM)", 80L, 26L);
    s_copy(chxtit + 240, "X (mm)", 80L, 6L);
    s_copy(chytit + 240, "Y (mm)", 80L, 6L);
    s_copy(chxtit + 320, "Sigma (mm)", 80L, 10L);
    s_copy(chytit + 320, "Relative Momentum Deviation", 80L, 27L);
    s_copy(chxtit + 400, "X (mm)", 80L, 6L);
    s_copy(chytit + 400, "Relative Momentum Deviation", 80L, 27L);
    s_copy(chxtit + 480, "Y (mm)", 80L, 6L);
    s_copy(chytit + 480, "Relative Momentum Deviation", 80L, 27L);
    s_copy(chxtit + 560, "N", 80L, 1L);
    s_copy(chytit + 560, "E (MeV)", 80L, 7L);
    s_copy(chxtit + 640, "X (mm)", 80L, 6L);
    s_copy(chytit + 640, "Normalized Slope of X (mm)", 80L, 26L);
    s_copy(chxtit + 720, "Y (mm)", 80L, 6L);
    s_copy(chytit + 720, "Normalized Slope of Y (mm)", 80L, 26L);
    s_copy(chxtit + 800, "Horizontal Tune Qx", 80L, 18L);
    s_copy(chytit + 800, "Normalized FFT Signal", 80L, 21L);
    s_copy(chxtit + 880, "Vertical Tune Qy", 80L, 16L);
    s_copy(chytit + 880, "Normalized FFT Signal", 80L, 21L);
    if (posti2_ .idis != 0 || posti2_ .icow != 0 || posti2_ .istw != 0 || 
	    posti2_ .iffw != 0) {
	hplsiz_(&c_b8147, &c_b8147, " ", 1L);
	hplset_("VSIZ", &c_b8151, 4L);
	hplset_("ASIZ", &c_b8153, 4L);
	hplset_("XLAB", &c_b8155, 4L);
	hplset_("YLAB", &c_b2366, 4L);
	hplset_("GSIZ", &c_b8153, 4L);
    }
    if (posti1_ .iav < 1) {
	posti1_ .iav = 1;
    }
    if (posti2_ .nprint == 1) {
	s_wsfe(&io___3263);
	do_fio(&c__1, sixtit, 80L);
	do_fio(&c__1, commen, 80L);
	e_wsfe();
	s_wsfe(&io___3264);
	do_fio(&c__1, progrm, 8L);
	do_fio(&c__1, (char *)&ifipa, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)&itopa, (ftnlen)sizeof(integer));
	do_fio(&c__1, hvs, 11L);
	do_fio(&c__1, (char *)&numl, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)&bet0[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&bet0x2, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&bet0x3, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&bet0[1], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&bet0z2, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&bet0z3, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&bet0[2], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&bet0s2, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&bet0s3, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&alf0[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&alf0x2, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&alf0x3, (ftnlen)sizeof(doublereal));
	e_wsfe();
	s_wsfe(&io___3265);
	do_fio(&c__1, (char *)&alf0[1], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&alf0z2, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&alf0z3, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&alf0[2], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&alf0s2, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&alf0s3, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&gam0x1, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&gam0x2, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&gam0x3, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&gam0z1, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&gam0z2, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&gam0z3, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&gam0s1, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&gam0s2, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&gam0s3, (ftnlen)sizeof(doublereal));
	e_wsfe();
	s_wsfe(&io___3266);
	do_fio(&c__1, (char *)&clo[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&clo[1], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&clo[2], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&clop[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&clop[1], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&clop[2], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&di0[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&di0[1], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&dip0[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&dip0[1], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&qwc[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&qwc[1], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&qwc[2], (ftnlen)sizeof(doublereal));
	e_wsfe();
	s_wsfe(&io___3267);
	do_fio(&c__1, (char *)& posti1_ .iav, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)& postr_ .nstart, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)& postr_ .nstop, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)& postr_ .dphix, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& postr_ .dphiz, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& posti1_ .iwg, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)& postr_ .qx0, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& postr_ .qz0, (ftnlen)sizeof(doublereal));
	e_wsfe();
	s_wsfe(&io___3268);
	do_fio(&c__1, (char *)& posti1_ .ivox, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)& posti1_ .ivoz, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)& posti1_ .ires, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)& postr_ .dres, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& posti1_ .ifh, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)& postr_ .dfft, (ftnlen)sizeof(doublereal));
	e_wsfe();
	s_wsfe(&io___3269);
	do_fio(&c__1, (char *)& posti2_ .kwtype, (ftnlen)sizeof(integer));
	i__1 = posti2_ .itf / 20;
	do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)& posti2_ .icr, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)& posti2_ .idis, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)& posti2_ .icow, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)& posti2_ .istw, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)& posti2_ .iffw, (ftnlen)sizeof(integer));
	e_wsfe();
	s_wsfe(&io___3270);
	do_fio(&c__1, (char *)& postr_ .iskip, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)& postr_ .iconv, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)& postr_ .imad, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)& postr_ .cma1, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& postr_ .cma2, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& posti2_ .nprint, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)& posti2_ .ndafi, (ftnlen)sizeof(integer));
	e_wsfe();
    }
 
    tpi = atan(1.) * 8;
    prec = .1;
    i1 = 0;
    i11 = 1;
    tlo = 0.;
    i2 = 0;
    ifp = 0;
    iwarx = 0;
    iwarz = 0;
    iwar6 = 0;
    iapx = 0;
    iapz = 0;
    iap6 = 0;
    ivo6 = 1;
    qs0 = 0.;
    armin0 = (float)1e9;
    armin = armin0;
    nivh = 500;
    finv = tpi / 1000;
    invari_ .dani[0] = 0.;
    invari_ .dani[1000] = tpi;
    for (i__ = 1; i__ <= 999; ++i__) {
 
	invari_ .dani[i__] = i__ * finv;
    }
    dle1 = 0.;
    bold = 0.;
    dle1c = 0.;
    const__ = (float)0.;
    dphx = 0.;
    dphz = 0.;
    dph6 = 0.;
    tphx = 0.;
    tphz = 0.;
    tph6 = 0.;
    sdpx = 0.;
    sdpz = 0.;
    sdp6 = 0.;
    evx = 0.;
    evz = 0.;
    evx2 = 0.;
    evz2 = 0.;
    evt = 0.;
    sevx = 0.;
    sevz = 0.;
    sevt = 0.;
    emax = 0.;
    emix = 0.;
    emaz = 0.;
    emiz = 0.;
    emag = 0.;
    emig = 0.;
    emxa = 0.;
    emza = 0.;
    emta = 0.;
    emxs = 0.;
    emzs = 0.;
    emts = 0.;
    nuex = 0;
    nuez = 0;
    nuix = 0;
    nuiz = 0;
    xing = 0.;
    zing = 0.;
    pinx = 0.;
    pinz = 0.;
    pixr = 0.;
    pizr = 0.;
 
    for (i__ = 1; i__ <= 6; ++i__) {
	for (j = 1; j <= 6; ++j) {
 
	    t[i__ + j * 6 - 7] = ta[j + i__ * 6 - 7];
	}
    }
    if ((( t[0] ) >= 0 ? ( t[0] ) : -( t[0] ))  <= 1e-17 && (( t[7] ) >= 0 ? ( t[7] ) : -( t[7] ))  <= 1e-17) {
	t[0] = 1.;
	t[7] = 1.;
    }
    if ((( t[14] ) >= 0 ? ( t[14] ) : -( t[14] ))  <= 1e-17 && (( t[21] ) >= 0 ? ( t[21] ) : -( t[21] ))  <= 1e-17) {
	t[14] = 1.;
	t[21] = 1.;
    }
    if ((( t[28] ) >= 0 ? ( t[28] ) : -( t[28] ))  <= 1e-17 && (( t[35] ) >= 0 ? ( t[35] ) : -( t[35] ))  <= 1e-17) {
	t[28] = 1.;
	t[35] = 1.;
    }
    tasum = 0.;
    cor_ .its6d = 0;
    for (i__ = 1; i__ <= 6; ++i__) {
	tasum = tasum + (d__1 = t[i__ + 23], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) + (d__2 = t[i__ + 29],
		 (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) );
 
    }
    for (i__ = 1; i__ <= 4; ++i__) {
	tasum = tasum + (d__1 = t[i__ * 6 - 2], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) + (d__2 = t[i__ * 
		6 - 1], (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) );
 
    }
    tasum += -2.;
    if ((( tasum ) >= 0 ? ( tasum ) : -( tasum ))  >= 1e-17) {
	cor_ .its6d = 1;
    }
    dinv_(&c__6, t, &c__6, rdummy, &nerror);
    if (nerror == -1) {
	s_wsfe(&io___3336);
	do_fio(&c__1, (char *)&(*nfile), (ftnlen)sizeof(integer));
	e_wsfe();
	goto L550;
    }
 

 
 

L190:
    ifipa = 0;
    if (ntwin == 1) {
	io___3337.ciunit = *nfile;
	ierro = s_rsue(&io___3337);
	if (ierro != 0) {
	    goto L100113;
	}
	ierro = do_uio(&c__1, (char *)&ia, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100113;
	}
	ierro = do_uio(&c__1, (char *)&ifipa, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100113;
	}
	ierro = do_uio(&c__1, (char *)&b, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100113;
	}
	ierro = do_uio(&c__1, (char *)&c__, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100113;
	}
	ierro = do_uio(&c__1, (char *)&d__, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100113;
	}
	ierro = do_uio(&c__1, (char *)&e, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100113;
	}
	ierro = do_uio(&c__1, (char *)&f, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100113;
	}
	ierro = do_uio(&c__1, (char *)&g, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100113;
	}
	ierro = do_uio(&c__1, (char *)&h__, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100113;
	}
	ierro = do_uio(&c__1, (char *)&p, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100113;
	}
	ierro = e_rsue();
L100113:
	if (ierro < 0) {
	    goto L200;
	}
    }
    if (ntwin == 2) {
	io___3346.ciunit = *nfile;
	ierro = s_rsue(&io___3346);
	if (ierro != 0) {
	    goto L100114;
	}
	ierro = do_uio(&c__1, (char *)&ia, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100114;
	}
	ierro = do_uio(&c__1, (char *)&ifipa, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100114;
	}
	ierro = do_uio(&c__1, (char *)&b, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100114;
	}
	ierro = do_uio(&c__1, (char *)&c__, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100114;
	}
	ierro = do_uio(&c__1, (char *)&d__, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100114;
	}
	ierro = do_uio(&c__1, (char *)&e, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100114;
	}
	ierro = do_uio(&c__1, (char *)&f, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100114;
	}
	ierro = do_uio(&c__1, (char *)&g, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100114;
	}
	ierro = do_uio(&c__1, (char *)&h__, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100114;
	}
	ierro = do_uio(&c__1, (char *)&p, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100114;
	}
	ierro = do_uio(&c__1, (char *)&ilapa, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100114;
	}
	ierro = do_uio(&c__1, (char *)&b, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100114;
	}
	ierro = do_uio(&c__1, (char *)&c1, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100114;
	}
	ierro = do_uio(&c__1, (char *)&d1, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100114;
	}
	ierro = do_uio(&c__1, (char *)&e1, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100114;
	}
	ierro = do_uio(&c__1, (char *)&f1, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100114;
	}
	ierro = do_uio(&c__1, (char *)&g1, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100114;
	}
	ierro = do_uio(&c__1, (char *)&h1, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100114;
	}
	ierro = do_uio(&c__1, (char *)&p1, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100114;
	}
	ierro = e_rsue();
L100114:
	if (ierro < 0) {
	    goto L200;
	}
    }
    if (ierro > 0) {
	s_wsfe(&io___3354);
	do_fio(&c__1, (char *)&(*nfile), (ftnlen)sizeof(integer));
	e_wsfe();
	goto L550;
    }
    if (ifipa < 1) {
	goto L190;
    }
    if ((doublereal) (ia - postr_ .nstart) < 0.) {
	goto L190;
    }
    if (s_cmp(progrm, "MAD", 8L, 3L) == 0) {
	c__ *= 1e3;
	d__ *= 1e3;
	e *= 1e3;
	f *= 1e3;
	h__ *= 1e3;
	p *= 1e3;
	if (ntwin == 2) {
	    c1 *= 1e3;
	    d1 *= 1e3;
	    e1 *= 1e3;
	    f1 *= 1e3;
	    h1 *= 1e3;
	    p1 *= 1e3;
	}
    }
    if (ntwin == 2) {
	x[0] = c__;
	x[2] = d__;
	x[4] = e;
	x[6] = f;
	x[8] = g;
	x[10] = h__;
	x[1] = c1;
	x[3] = d1;
	x[5] = e1;
	x[7] = f1;
	x[9] = g1;
	x[11] = h1;
	distance_(x, cloau, di0au, t, &b);
    }
    if (postr_ .nstop > postr_ .nstart && (doublereal) (ia - postr_ .nstop) > 
	    0.) {
	goto L200;
    }
    if (b < b0 || (( b0 ) >= 0 ? ( b0 ) : -( b0 ))  <= 1e-17) {
	b0 = b;
    }
    goto L190;
L200:
    if (ia <= 0) {
	goto L530;
    }
    al__1.aerr = 0;
    al__1.aunit = *nfile;
    f_rew(&al__1);
 

 
 

    io___3355.ciunit = *nfile;
    ierro = s_rsue(&io___3355);
    if (ierro != 0) {
	goto L100115;
    }
    ierro = e_rsue();
L100115:
    if (ierro > 0) {
	s_wsfe(&io___3356);
	do_fio(&c__1, (char *)&(*nfile), (ftnlen)sizeof(integer));
	e_wsfe();
	goto L550;
    }
L210:
    ifipa = 0;
    if (ntwin == 1) {
	io___3357.ciunit = *nfile;
	ierro = s_rsue(&io___3357);
	if (ierro != 0) {
	    goto L100116;
	}
	ierro = do_uio(&c__1, (char *)&ia, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100116;
	}
	ierro = do_uio(&c__1, (char *)&ifipa, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100116;
	}
	ierro = do_uio(&c__1, (char *)&b, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100116;
	}
	ierro = do_uio(&c__1, (char *)&c__, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100116;
	}
	ierro = do_uio(&c__1, (char *)&d__, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100116;
	}
	ierro = do_uio(&c__1, (char *)&e, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100116;
	}
	ierro = do_uio(&c__1, (char *)&f, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100116;
	}
	ierro = do_uio(&c__1, (char *)&g, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100116;
	}
	ierro = do_uio(&c__1, (char *)&h__, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100116;
	}
	ierro = do_uio(&c__1, (char *)&p, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100116;
	}
	ierro = e_rsue();
L100116:
	if (ierro < 0) {
	    goto L530;
	}
    }
    if (ntwin == 2) {
	io___3358.ciunit = *nfile;
	ierro = s_rsue(&io___3358);
	if (ierro != 0) {
	    goto L100117;
	}
	ierro = do_uio(&c__1, (char *)&ia, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100117;
	}
	ierro = do_uio(&c__1, (char *)&ifipa, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100117;
	}
	ierro = do_uio(&c__1, (char *)&b, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100117;
	}
	ierro = do_uio(&c__1, (char *)&c__, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100117;
	}
	ierro = do_uio(&c__1, (char *)&d__, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100117;
	}
	ierro = do_uio(&c__1, (char *)&e, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100117;
	}
	ierro = do_uio(&c__1, (char *)&f, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100117;
	}
	ierro = do_uio(&c__1, (char *)&g, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100117;
	}
	ierro = do_uio(&c__1, (char *)&h__, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100117;
	}
	ierro = do_uio(&c__1, (char *)&p, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100117;
	}
	ierro = do_uio(&c__1, (char *)&ilapa, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100117;
	}
	ierro = do_uio(&c__1, (char *)&b, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100117;
	}
	ierro = do_uio(&c__1, (char *)&c1, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100117;
	}
	ierro = do_uio(&c__1, (char *)&d1, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100117;
	}
	ierro = do_uio(&c__1, (char *)&e1, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100117;
	}
	ierro = do_uio(&c__1, (char *)&f1, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100117;
	}
	ierro = do_uio(&c__1, (char *)&g1, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100117;
	}
	ierro = do_uio(&c__1, (char *)&h1, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100117;
	}
	ierro = do_uio(&c__1, (char *)&p1, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100117;
	}
	ierro = e_rsue();
L100117:
	if (ierro < 0) {
	    goto L530;
	}
    }
    if (ierro > 0) {
	s_wsfe(&io___3359);
	do_fio(&c__1, (char *)&(*nfile), (ftnlen)sizeof(integer));
	e_wsfe();
	goto L550;
    }
    if (ifipa < 1) {
	goto L210;
    }
    if (ia - postr_ .nstart < 0) {
	goto L210;
    }
    if (s_cmp(progrm, "MAD", 8L, 3L) == 0) {
	c__ *= 1e3;
	d__ *= 1e3;
	e *= 1e3;
	f *= 1e3;
	g *= 1e3;
	p *= 1e3;
	if (ntwin == 2) {
	    c1 *= 1e3;
	    d1 *= 1e3;
	    e1 *= 1e3;
	    f1 *= 1e3;
	    g1 *= 1e3;
	    p1 *= 1e3;
	}
    }
    dp1 = h__;
    s_wsfi(&io___3361);
    d__1 = dp1 - clop[2];
    do_fio(&c__1, (char *)&d__1, (ftnlen)sizeof(doublereal));
    e_wsfi();
    if (posti2_ .nprint == 1 && ia == 0) {
	s_wsle(&io___3362);
	do_lio(&c__9, &c__1, "INITIAL COORDINATES", 19L);
	e_wsle();
	s_wsle(&io___3363);
	do_lio(&c__9, &c__1, "       X = ", 11L);
	do_lio(&c__5, &c__1, (char *)&c__, (ftnlen)sizeof(doublereal));
	e_wsle();
	s_wsle(&io___3364);
	do_lio(&c__9, &c__1, "      XP = ", 11L);
	do_lio(&c__5, &c__1, (char *)&d__, (ftnlen)sizeof(doublereal));
	e_wsle();
	s_wsle(&io___3365);
	do_lio(&c__9, &c__1, "       Z = ", 11L);
	do_lio(&c__5, &c__1, (char *)&e, (ftnlen)sizeof(doublereal));
	e_wsle();
	s_wsle(&io___3366);
	do_lio(&c__9, &c__1, "      ZP = ", 11L);
	do_lio(&c__5, &c__1, (char *)&f, (ftnlen)sizeof(doublereal));
	e_wsle();
	s_wsle(&io___3367);
	do_lio(&c__9, &c__1, "   SIGMA = ", 11L);
	do_lio(&c__5, &c__1, (char *)&g, (ftnlen)sizeof(doublereal));
	e_wsle();
	s_wsle(&io___3368);
	do_lio(&c__9, &c__1, "    DP/P = ", 11L);
	do_lio(&c__5, &c__1, (char *)&h__, (ftnlen)sizeof(doublereal));
	e_wsle();
	s_wsle(&io___3369);
	do_lio(&c__9, &c__1, "  ENERGY = ", 11L);
	do_lio(&c__5, &c__1, (char *)&p, (ftnlen)sizeof(doublereal));
	e_wsle();
    }
    if (postr_ .nstop > postr_ .nstart && ia - postr_ .nstop > 0) {
	goto L540;
    }
    ia -= postr_ .nstart;
 
    if (ntwin == 2) {
	x[0] = c__;
	x[2] = d__;
	x[4] = e;
	x[6] = f;
	x[8] = g;
	x[10] = h__;
	x[1] = c1;
	x[3] = d1;
	x[5] = e1;
	x[7] = f1;
	x[9] = g1;
	x[11] = h1;
	distance_(x, cloau, di0au, t, &b);
    }
 
    ia0 = ia;
    xxr[0] = c__;
    xxi[0] = 0.;
    zzr[0] = e;
    zzi[0] = 0.;
    c__ -= clo[0];
    d__ -= clop[0];
    e -= clo[1];
    f -= clop[1];
    g -= clo[2];
    h__ -= clop[2];
    c1 -= clo[0];
    d1 -= clop[0];
    e1 -= clo[1];
    f1 -= clop[1];
    g1 -= clo[2];
    h1 -= clop[2];
    if (cor_ .icode >= 4) {
	c__ -= di0[0] * h__;
	d__ -= dip0[0] * h__;
	e -= di0[1] * h__;
	f -= dip0[1] * h__;
	c1 -= di0[0] * h__;
	d1 -= dip0[0] * h__;
	e1 -= di0[1] * h__;
	f1 -= dip0[1] * h__;
    }
 
    xp0 = bet0[0] * d__ + alf0[0] * c__;
    zp0 = bet0[1] * f + alf0[1] * e;
    emx = (c__ * c__ + xp0 * xp0) / bet0[0];
    emz = (e * e + zp0 * zp0) / bet0[1];
    if (cor_ .icode >= 4 && cor_ .its6d != 0) {
	c__ += di0[0] * h__;
	d__ += dip0[0] * h__;
	e += di0[1] * h__;
	f += dip0[1] * h__;
	c1 += di0[0] * h__;
	d1 += dip0[0] * h__;
	e1 += di0[1] * h__;
	f1 += dip0[1] * h__;
    }
    emt = emx + emz;
    emax = emx;
    emix = emx;
    emxa = emx;
    emaz = emz;
    emiz = emz;
    emza = emz;
    emat = emt;
    emit = emt;
    emta = emt;
    emx0 = emx;
    emz0 = emz;
 
    xyzv[0] = c__;
    xyzv[1] = d__;
    xyzv[2] = e;
    xyzv[3] = f;
    xyzv[4] = g;
    xyzv[5] = h__;
 
    if (cor_ .its6d == 1) {
	xyzv[1] *= xyzv[5] + 1. + clop[2];
	xyzv[3] *= xyzv[5] + 1. + clop[2];
    }
    for (iq = 1; iq <= 6; ++iq) {
	txyz[iq - 1] = 0.;
	for (jq = 1; jq <= 6; ++jq) {
	    txyz[iq - 1] += t[jq + iq * 6 - 7] * xyzv[jq - 1];
 
	}
    }
 
    if (posti2_ .nprint == 1 && ia == 0) {
	s_wsle(&io___3382);
	do_lio(&c__9, &c__1, "DISTANCE = ", 11L);
	do_lio(&c__5, &c__1, (char *)&b, (ftnlen)sizeof(doublereal));
	e_wsle();
    }
 
    evx = txyz[0] * txyz[0] + txyz[1] * txyz[1];
    evz = txyz[2] * txyz[2] + txyz[3] * txyz[3];
    xyzv2[0] = c1;
    xyzv2[1] = d1;
    xyzv2[2] = e1;
    xyzv2[3] = f1;
    xyzv2[4] = g1;
    xyzv2[5] = h1;
 
    if (cor_ .its6d == 1) {
	xyzv2[1] *= xyzv2[5] + 1. + clop[2];
	xyzv2[3] *= xyzv2[5] + 1. + clop[2];
    }
    for (iq = 1; iq <= 6; ++iq) {
	txyz2[iq - 1] = 0.;
	for (jq = 1; jq <= 6; ++jq) {
	    txyz2[iq - 1] += t[jq + iq * 6 - 7] * xyzv2[jq - 1];
 
	}
    }
    evx2 = txyz2[0] * txyz2[0] + txyz2[1] * txyz2[1];
    evz2 = txyz2[2] * txyz2[2] + txyz2[3] * txyz2[3];
    s_wsfi(&io___3383);
    d__1 = sqrt(evx * bet0[0]) + sqrt(evz * bet0x2);
    do_fio(&c__1, (char *)&d__1, (ftnlen)sizeof(doublereal));
    e_wsfi();
    s_wsfi(&io___3384);
    d__1 = sqrt(evz * bet0[1]) + sqrt(evx * bet0z2);
    do_fio(&c__1, (char *)&d__1, (ftnlen)sizeof(doublereal));
    e_wsfi();
    if (cor_ .its6d == 1) {
	emiii = txyz[4] * txyz[4] * postr_ .cma2 * postr_ .cma2 + txyz[5] * 
		txyz[5] * postr_ .cma1 * postr_ .cma1;
    } else {
	emiii = 0.;
    }
 
    for (iq = 1; iq <= 6; ++iq) {
	txyz[iq - 1] *= rbeta[iq - 1];
 
    }
    c0 = txyz[0];
    d0 = txyz[1];
    e0 = txyz[2];
    f0 = txyz[3];
    g0 = txyz[4] * postr_ .cma2;
    h0 = txyz[5] * postr_ .cma1;
 
    pmin[1] = b;
    pmax[1] = b;
    pmin[2] = c0;
    pmax[2] = c0;
    pmin[3] = d0;
    pmax[3] = d0;
    pmin[4] = e0;
    pmax[4] = e0;
    pmin[5] = f0;
    pmax[5] = f0;
    pmin[8] = g0;
    pmax[8] = g0;
    pmin[9] = h0;
    pmax[9] = h0;
    pmin[15] = p;
    pmax[15] = p;
 
    emi = evx;
    emii = evz;
    angi = 0.;
    angii = 0.;
    angiii = 0.;
    if ((( txyz[0] ) >= 0 ? ( txyz[0] ) : -( txyz[0] ))  > 1e-17 || (( txyz[1] ) >= 0 ? ( txyz[1] ) : -( txyz[1] ))  > 1e-17) {
	angi = atan2(txyz[1], txyz[0]);
    }
    if ((( txyz[2] ) >= 0 ? ( txyz[2] ) : -( txyz[2] ))  > 1e-17 || (( txyz[3] ) >= 0 ? ( txyz[3] ) : -( txyz[3] ))  > 1e-17) {
	angii = atan2(txyz[3], txyz[2]);
    }
    if ((( txyz[4] ) >= 0 ? ( txyz[4] ) : -( txyz[4] ))  > 1e-17 || (( txyz[5] ) >= 0 ? ( txyz[5] ) : -( txyz[5] ))  > 1e-17) {
	angiii = atan2(txyz[5] * postr_ .cma1, txyz[4] * postr_ .cma2);
    }
    evt = evx + evz;
    evxma = evx;
    evzma = evz;
    evtma = evt;
    evxmi = evx;
    evzmi = evz;
    evtmi = evt;
 
    caconv_(&dpx, &d0, &c0);
    caconv_(&dpz, &f0, &e0);
    dpxp = tpi + dpx;
    dpzp = tpi + dpz;
 
    cinvar_(&dpx, & postr_ .dphix, &dpz, &dpzp, &nuex, &emz, zinv, invz);
    cinvar_(&dpz, & postr_ .dphiz, &dpx, &dpxp, &nuez, &emx, xinv, invx);
 

 
 

    iskc = 0;
L240:
    ifipa = 0;
    if (ntwin == 1) {
	io___3408.ciunit = *nfile;
	ierro = s_rsue(&io___3408);
	if (ierro != 0) {
	    goto L100118;
	}
	ierro = do_uio(&c__1, (char *)&ia, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100118;
	}
	ierro = do_uio(&c__1, (char *)&ifipa, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100118;
	}
	ierro = do_uio(&c__1, (char *)&b, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100118;
	}
	ierro = do_uio(&c__1, (char *)&c__, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100118;
	}
	ierro = do_uio(&c__1, (char *)&d__, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100118;
	}
	ierro = do_uio(&c__1, (char *)&e, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100118;
	}
	ierro = do_uio(&c__1, (char *)&f, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100118;
	}
	ierro = do_uio(&c__1, (char *)&g, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100118;
	}
	ierro = do_uio(&c__1, (char *)&h__, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100118;
	}
	ierro = do_uio(&c__1, (char *)&p, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100118;
	}
	ierro = e_rsue();
L100118:
	if (ierro < 0) {
	    goto L270;
	}
    }
    if (ntwin == 2) {
	io___3409.ciunit = *nfile;
	ierro = s_rsue(&io___3409);
	if (ierro != 0) {
	    goto L100119;
	}
	ierro = do_uio(&c__1, (char *)&ia, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100119;
	}
	ierro = do_uio(&c__1, (char *)&ifipa, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100119;
	}
	ierro = do_uio(&c__1, (char *)&b, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100119;
	}
	ierro = do_uio(&c__1, (char *)&c__, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100119;
	}
	ierro = do_uio(&c__1, (char *)&d__, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100119;
	}
	ierro = do_uio(&c__1, (char *)&e, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100119;
	}
	ierro = do_uio(&c__1, (char *)&f, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100119;
	}
	ierro = do_uio(&c__1, (char *)&g, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100119;
	}
	ierro = do_uio(&c__1, (char *)&h__, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100119;
	}
	ierro = do_uio(&c__1, (char *)&p, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100119;
	}
	ierro = do_uio(&c__1, (char *)&ilapa, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100119;
	}
	ierro = do_uio(&c__1, (char *)&b, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100119;
	}
	ierro = do_uio(&c__1, (char *)&c1, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100119;
	}
	ierro = do_uio(&c__1, (char *)&d1, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100119;
	}
	ierro = do_uio(&c__1, (char *)&e1, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100119;
	}
	ierro = do_uio(&c__1, (char *)&f1, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100119;
	}
	ierro = do_uio(&c__1, (char *)&g1, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100119;
	}
	ierro = do_uio(&c__1, (char *)&h1, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100119;
	}
	ierro = do_uio(&c__1, (char *)&p1, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100119;
	}
	ierro = e_rsue();
L100119:
	if (ierro < 0) {
	    goto L270;
	}
    }
    if (ierro > 0) {
	s_wsfe(&io___3410);
	do_fio(&c__1, (char *)&(*nfile), (ftnlen)sizeof(integer));
	e_wsfe();
	goto L550;
    }
    if (ifipa < 1) {
	goto L240;
    }
    if (s_cmp(progrm, "MAD", 8L, 3L) == 0) {
	c__ *= 1e3;
	d__ *= 1e3;
	e *= 1e3;
	f *= 1e3;
	g *= 1e3;
	p *= 1e3;
	if (ntwin == 2) {
	    c1 *= 1e3;
	    d1 *= 1e3;
	    e1 *= 1e3;
	    f1 *= 1e3;
	    g1 *= 1e3;
	    p1 *= 1e3;
	}
    }
 
    if (ntwin == 2) {
	x[0] = c__;
	x[2] = d__;
	x[4] = e;
	x[6] = f;
	x[8] = g;
	x[10] = h__;
	x[1] = c1;
	x[3] = d1;
	x[5] = e1;
	x[7] = f1;
	x[9] = g1;
	x[11] = h1;
	distance_(x, cloau, di0au, t, &b);
    }
    ++iskc;
    if (iskc % postr_ .iskip != 0) {
	goto L240;
    }
    if (postr_ .nstop > postr_ .nstart && ia - postr_ .nstop > 0) {
	goto L270;
    }
    ++i1;
    i11 = i1 + 1;
    if (i2 >= 10000 && i11 > nfft && iapx > 20000 && iapz > 20000) {
	goto L270;
    }
    if (i11 <= nfft) {
	xxr[i11 - 1] = c__;
	xxi[i11 - 1] = 0.;
    }
    if (i11 <= nfft) {
	zzr[i11 - 1] = e;
	zzi[i11 - 1] = 0.;
    }
    c__ -= clo[0];
    d__ -= clop[0];
    e -= clo[1];
    f -= clop[1];
    g -= clo[2];
    h__ -= clop[2];
    if (cor_ .icode >= 4) {
	c__ -= di0[0] * h__;
	d__ -= dip0[0] * h__;
	e -= di0[1] * h__;
	f -= dip0[1] * h__;
    }
 
    xp = bet0[0] * d__ + alf0[0] * c__;
    zp = bet0[1] * f + alf0[1] * e;
    emx = (c__ * c__ + xp * xp) / bet0[0];
    emz = (e * e + zp * zp) / bet0[1];
    if (cor_ .icode >= 4 && cor_ .its6d != 0) {
	c__ += di0[0] * h__;
	d__ += dip0[0] * h__;
	e += di0[1] * h__;
	f += dip0[1] * h__;
    }
    emt = emx + emz;
    emxa += emx;
    emza += emz;
    emta += emt;
    emax = (( emx ) >= ( emax ) ? ( emx ) : ( emax )) ;
    emix = (( emx ) <= ( emix ) ? ( emx ) : ( emix )) ;
    emaz = (( emz ) >= ( emaz ) ? ( emz ) : ( emaz )) ;
    emiz = (( emz ) <= ( emiz ) ? ( emz ) : ( emiz )) ;
    emat = (( emt ) >= ( emat ) ? ( emt ) : ( emat )) ;
    emit = (( emt ) <= ( emit ) ? ( emt ) : ( emit )) ;
 
    xyzv[0] = c__;
    xyzv[1] = d__;
    xyzv[2] = e;
    xyzv[3] = f;
    xyzv[4] = g;
    xyzv[5] = h__;
 
    if (cor_ .its6d == 1) {
	xyzv[1] *= xyzv[5] + 1. + clop[2];
	xyzv[3] *= xyzv[5] + 1. + clop[2];
    }
    for (iq = 1; iq <= 6; ++iq) {
	txyz[iq - 1] = 0.;
	for (jq = 1; jq <= 6; ++jq) {
	    txyz[iq - 1] += t[jq + iq * 6 - 7] * xyzv[jq - 1];
 
	}
    }
 
    evx1 = txyz[0] * txyz[0] + txyz[1] * txyz[1];
    evz1 = txyz[2] * txyz[2] + txyz[3] * txyz[3];
 
    for (iq = 1; iq <= 6; ++iq) {
	txyz[iq - 1] *= rbeta[iq - 1];
 
    }
    c__ = txyz[0];
    d__ = txyz[1];
    e = txyz[2];
    f = txyz[3];
    g = txyz[4] * postr_ .cma2;
    h__ = txyz[5] * postr_ .cma1;
 
    pmin[1] = (( pmin[1] ) <= ( b ) ? ( pmin[1] ) : ( b )) ;
    pmax[1] = (( pmax[1] ) >= ( b ) ? ( pmax[1] ) : ( b )) ;
    pmin[2] = (( pmin[2] ) <= ( c__ ) ? ( pmin[2] ) : ( c__ )) ;
    pmax[2] = (( pmax[2] ) >= ( c__ ) ? ( pmax[2] ) : ( c__ )) ;
    pmin[3] = (( pmin[3] ) <= ( d__ ) ? ( pmin[3] ) : ( d__ )) ;
    pmax[3] = (( pmax[3] ) >= ( d__ ) ? ( pmax[3] ) : ( d__ )) ;
    pmin[4] = (( pmin[4] ) <= ( e ) ? ( pmin[4] ) : ( e )) ;
    pmax[4] = (( pmax[4] ) >= ( e ) ? ( pmax[4] ) : ( e )) ;
    pmin[5] = (( pmin[5] ) <= ( f ) ? ( pmin[5] ) : ( f )) ;
    pmax[5] = (( pmax[5] ) >= ( f ) ? ( pmax[5] ) : ( f )) ;
    pmin[8] = (( pmin[8] ) <= ( g ) ? ( pmin[8] ) : ( g )) ;
    pmax[8] = (( pmax[8] ) >= ( g ) ? ( pmax[8] ) : ( g )) ;
    pmin[9] = (( pmin[9] ) <= ( h__ ) ? ( pmin[9] ) : ( h__ )) ;
    pmax[9] = (( pmax[9] ) >= ( h__ ) ? ( pmax[9] ) : ( h__ )) ;
    pmin[15] = (( pmin[15] ) <= ( p ) ? ( pmin[15] ) : ( p )) ;
    pmax[15] = (( pmax[15] ) >= ( p ) ? ( pmax[15] ) : ( p )) ;
 
    ia -= postr_ .nstart;
 
    if (i1 == 1) {
	idnt = ia - ia0;
    }
    bold += b;
    b -= b0;
    dle1c = 0.;
    if (b > 0.) {
	dle1c = log(b);
    }
    if (b < 0.) {
	dle1c = -log(-b);
    }
    dle1 += dle1c;
 
    evt1 = evx1 + evz1;
    evxma = (( evx1 ) >= ( evxma ) ? ( evx1 ) : ( evxma )) ;
    evzma = (( evz1 ) >= ( evzma ) ? ( evz1 ) : ( evzma )) ;
    evtma = (( evt1 ) >= ( evtma ) ? ( evt1 ) : ( evtma )) ;
    evxmi = (( evx1 ) <= ( evxmi ) ? ( evx1 ) : ( evxmi )) ;
    evzmi = (( evz1 ) <= ( evzmi ) ? ( evz1 ) : ( evzmi )) ;
    evtmi = (( evt1 ) <= ( evtmi ) ? ( evt1 ) : ( evtmi )) ;
    evx += evx1;
    evz += evz1;
    evt += evt1;
 
    sx = c__ * d0 - c0 * d__;
    cx = c0 * c__ + d__ * d0;
    if (iapx <= 20000) {
	cphase_(&c__1, &dphx, &sx, &cx, & postr_ .qx0, & posti1_ .ivox, &iwarx, 
		&iapx);
    }
    sz = e * f0 - e0 * f;
    cz = e0 * e + f * f0;
    if (iapz <= 20000) {
	cphase_(&c__2, &dphz, &sz, &cz, & postr_ .qz0, & posti1_ .ivoz, &iwarz, 
		&iapz);
    }
    s6 = g * h0 - g0 * h__;
    c6 = h0 * h__ + g * g0;
    if (iap6 <= 20000) {
	cphase_(&c__3, &dph6, &s6, &c6, &qs0, &ivo6, &iwar6, &iap6);
    }
 
    if (i1 % posti1_ .iav == 0) {
	if (i2 >= 10000) {
	    goto L240;
	}
	++i2;
	dle[i2 - 1] = dle1 / posti1_ .iav;
	if (ia > 0) {
	    tle1 = (doublereal) ia;
	    tle1 = log(tle1);
	    if (i2 > 1) {
		biav[i2 - 2] = bold / posti1_ .iav;
		if (i2 == 2) {
		    biav[0] *= .5;
		}
		bold = 0.;
		tle[i2 - 1] = (tle1 + tlo) * .5;
		if ((d__1 = tle1 - tlo, (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		    wgh[i2 - 1] = 1. / (tle1 - tlo);
		} else {
		    s_wsfe(&io___3424);
		    do_fio(&c__1, (char *)&(*nfile), (ftnlen)sizeof(integer));
		    e_wsfe();
		    wgh[i2 - 1] = 0.;
		}
	    } else {
		tle[i2 - 1] = tle1 * .5;
		wgh[i2 - 1] = 1. / tle1;
	    }
	} else {
	    tle[i2 - 1] = 0.;
	    wgh[i2 - 1] = 0.;
	}
	tlo = tle1;
	dle1 = 0.;
    }
 
    caconv_(&dpx, &d__, &c__);
    caconv_(&dpz, &f, &e);
    dpxp = tpi + dpx;
    dpzp = tpi + dpz;
 
    cinvar_(&dpx, & postr_ .dphix, &dpz, &dpzp, &nuex, &emz, zinv, invz);
    cinvar_(&dpz, & postr_ .dphiz, &dpx, &dpxp, &nuez, &emx, xinv, invx);
 
    c0 = c__;
    d0 = d__;
    e0 = e;
    f0 = f;
    g0 = g;
    h0 = h__;
    goto L240;
L270:
    if (i2 < 1) {
	i2 = 1;
    }
 

 
 

 
    i__1 = i2;
    for (i__ = 2; i__ <= i__1; ++i__) {
	if (posti1_ .iwg == 1) {
	    lfitw_(tle, dle, wgh, &i__, &c__1, &slope[i__ - 2], &const__, &
		    varlea[i__ - 2]);
	}
	if (posti1_ .iwg == 0) {
	    lfit_(tle, dle, &i__, &c__1, &slope[i__ - 2], &const__, &varlea[
		    i__ - 2]);
	}
 
    }
    if (iapx == 0) {
	s_wsle(&io___3425);
	do_lio(&c__9, &c__1, "WARNING: IAPX IS ZERO", 21L);
	e_wsle();
	iapx = 1;
    }
    if (iapz == 0) {
	s_wsle(&io___3426);
	do_lio(&c__9, &c__1, "WARNING: IAPZ IS ZERO", 21L);
	e_wsle();
	iapz = 1;
    }
    tphx = dphx / iapx;
    tphz = dphz / iapz;
    if (iap6 > 0) {
	tph6 = dph6 / iap6;
    }
 
    i__1 = iapx;
    for (i__ = 1; i__ <= i__1; ++i__) {
 
	sdpx += ((phase_._2) .phase[i__ * 3 - 3] - tphx) * ((phase_._2) .phase[i__ * 3 
		- 3] - tphx);
    }
    i__1 = iapz;
    for (i__ = 1; i__ <= i__1; ++i__) {
 
	sdpz += ((phase_._2) .phase[i__ * 3 - 2] - tphz) * ((phase_._2) .phase[i__ * 3 
		- 2] - tphz);
    }
    i__1 = iap6;
    for (i__ = 1; i__ <= i__1; ++i__) {
 
	sdp6 += ((phase_._2) .phase[i__ * 3 - 1] - tph6) * ((phase_._2) .phase[i__ * 3 
		- 1] - tph6);
    }
    sdpx = sqrt(sdpx) / iapx;
    sdpz = sqrt(sdpz) / iapz;
    if (iap6 > 0) {
	sdp6 = sqrt(sdp6) / iap6;
    }
 
    di11 = (doublereal) i11;
    if (i11 == 0) {
	s_wsle(&io___3428);
	do_lio(&c__9, &c__1, "** ERROR ** - I11 IS ZERO", 25L);
	e_wsle();
	goto L550;
    }
    emxa /= di11;
    emza /= di11;
    emta /= di11;
    evxm = evx / di11;
    evzm = evz / di11;
    evtm = evt / di11;
 
    al__1.aerr = 0;
    al__1.aunit = *nfile;
    f_rew(&al__1);
    io___3432.ciunit = *nfile;
    ierro = s_rsue(&io___3432);
    if (ierro != 0) {
	goto L100120;
    }
    ierro = e_rsue();
L100120:
    if (ierro > 0) {
	s_wsfe(&io___3433);
	do_fio(&c__1, (char *)&(*nfile), (ftnlen)sizeof(integer));
	e_wsfe();
	goto L550;
    }
    iskc = -1;
    i__1 = i11 * postr_ .iskip + postr_ .nstart;
    for (i__ = 1; i__ <= i__1; ++i__) {
	ifipa = 0;
	io___3434.ciunit = *nfile;
	ierro = s_rsue(&io___3434);
	if (ierro != 0) {
	    goto L100121;
	}
	ierro = do_uio(&c__1, (char *)&ia, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100121;
	}
	ierro = do_uio(&c__1, (char *)&ifipa, (ftnlen)sizeof(integer));
	if (ierro != 0) {
	    goto L100121;
	}
	ierro = do_uio(&c__1, (char *)&b, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100121;
	}
	ierro = do_uio(&c__1, (char *)&c__, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100121;
	}
	ierro = do_uio(&c__1, (char *)&d__, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100121;
	}
	ierro = do_uio(&c__1, (char *)&e, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100121;
	}
	ierro = do_uio(&c__1, (char *)&f, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100121;
	}
	ierro = do_uio(&c__1, (char *)&g, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100121;
	}
	ierro = do_uio(&c__1, (char *)&h__, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100121;
	}
	ierro = do_uio(&c__1, (char *)&p, (ftnlen)sizeof(doublereal));
	if (ierro != 0) {
	    goto L100121;
	}
	ierro = e_rsue();
L100121:
	if (ierro < 0) {
	    goto L350;
	}
	if (ierro > 0) {
	    s_wsfe(&io___3435);
	    do_fio(&c__1, (char *)&(*nfile), (ftnlen)sizeof(integer));
	    e_wsfe();
	    goto L550;
	}
	if (ifipa < 1) {
	    goto L340;
	}
	if (s_cmp(progrm, "MAD", 8L, 3L) == 0) {
	    c__ *= 1e3;
	    d__ *= 1e3;
	    e *= 1e3;
	    f *= 1e3;
	    g *= 1e3;
	    p *= 1e3;
	}
	++iskc;
	if (iskc % postr_ .iskip != 0) {
	    goto L340;
	}
	if (ia - postr_ .nstart < 0) {
	    goto L340;
	}
	c__ -= clo[0];
	d__ -= clop[0];
	e -= clo[1];
	f -= clop[1];
	g -= clo[2];
	h__ -= clop[2];
	if (cor_ .icode >= 4) {
	    c__ -= di0[0] * h__;
	    d__ -= dip0[0] * h__;
	    e -= di0[1] * h__;
	    f -= dip0[1] * h__;
	}
 
	xp = bet0[0] * d__ + alf0[0] * c__;
	zp = bet0[1] * f + alf0[1] * e;
	emx = (c__ * c__ + xp * xp) / bet0[0];
	emz = (e * e + zp * zp) / bet0[1];
	if (cor_ .icode >= 4 && cor_ .its6d != 0) {
	    c__ += di0[0] * h__;
	    d__ += dip0[0] * h__;
	    e += di0[1] * h__;
	    f += dip0[1] * h__;
	}
	emt = emx + emz;
	emxs += (emx - emxa) * (emx - emxa);
	emzs += (emz - emza) * (emz - emza);
	emts += (emt - emta) * (emt - emta);
 
	xyzv[0] = c__;
	xyzv[1] = d__;
	xyzv[2] = e;
	xyzv[3] = f;
	xyzv[4] = g;
	xyzv[5] = h__;
 
	if (cor_ .its6d == 1) {
	    xyzv[1] *= xyzv[5] + 1. + clop[2];
	    xyzv[3] *= xyzv[5] + 1. + clop[2];
	}
	for (iq = 1; iq <= 6; ++iq) {
	    txyz[iq - 1] = 0.;
	    for (jq = 1; jq <= 6; ++jq) {
		txyz[iq - 1] += t[jq + iq * 6 - 7] * xyzv[jq - 1];
 
	    }
	}
 
	evx = txyz[0] * txyz[0] + txyz[1] * txyz[1];
	evz = txyz[2] * txyz[2] + txyz[3] * txyz[3];
 
	for (iq = 1; iq <= 6; ++iq) {
	    txyz[iq - 1] *= rbeta[iq - 1];
 
	}
	c__ = txyz[0];
	d__ = txyz[1];
	e = txyz[2];
	f = txyz[3];
	g = txyz[4];
	h__ = txyz[5];
 
	evt = evx + evz;
	sevx += (evx - evxm) * (evx - evxm);
	sevz += (evz - evzm) * (evz - evzm);
	sevt += (evt - evtm) * (evt - evtm);
L340:
	;
    }
L350:
 
    sinpro_(&emxa, &di11, &emxs, &emax, &emix);
    sinpro_(&emza, &di11, &emzs, &emaz, &emiz);
    sinpro_(&emta, &di11, &emts, &emat, &emit);
    sinpro_(&evxm, &di11, &sevx, &evxma, &evxmi);
    sinpro_(&evzm, &di11, &sevz, &evzma, &evzmi);
    sinpro_(&evtm, &di11, &sevt, &evtma, &evtmi);
 

 
 

    if (postr_ .nstop < ia && (ia < numl || ia < i_dnnt(&dnumlr))) {
	nlost = 1;
    }
    if (postr2_ .nnumxv[ifipa - 1] == 0 && postr2_ .nnumxv[ilapa - 1] == 0) {
	sumda[21] = (doublereal) ia;
	sumda[22] = (doublereal) ia;
    } else {
	sumda[21] = (doublereal) postr2_ .nnumxv[ifipa - 1];
	sumda[22] = (doublereal) postr2_ .nnumxv[ilapa - 1];
    }
    sumda[1] = (doublereal) nlost;
    sumda[8] = dp1 - clop[2];
 
 
    tidnt = (doublereal) ((ia - postr_ .nstart + idnt) / i11);
    if (i2 >= 2) {
	if (posti2_ .nprint == 1) {
	    s_wsfe(&io___3437);
	    e_wsfe();
	}
	ilyap = 0;
	slopem = 0.;
	i__1 = i2 - 1;
	for (i__ = 1; i__ <= i__1; ++i__) {
	    d__1 = (i__ + 1) * posti1_ .iav * tidnt;
	    iturn = i_dnnt(&d__1);
	    if (posti2_ .nprint == 1) {
		s_wsfe(&io___3441);
		do_fio(&c__1, (char *)&iturn, (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)&biav[i__ - 1], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)&slope[i__ - 1], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)&varlea[i__ - 1], (ftnlen)sizeof(
			doublereal));
		e_wsfe();
	    }
	    if (biav[i__ - 1] > .1) {
		ilyap = 1;
	    }
 
	    d__1 = slopem, d__2 = slope[i__ - 1];
	    slopem = (( d__1 ) >= ( d__2 ) ? ( d__1 ) : ( d__2 )) ;
 
	}
	if (posti2_ .nprint == 1) {
	    s_wsfe(&io___3442);
	    e_wsfe();
	}
	sumda[9] = biav[i2 - 2];
	if (ilyap == 0) {
	    sumda[10] = slope[i2 - 2];
	} else {
	    sumda[10] = slopem;
	}
    }
 
    tph6 = (( tph6 ) >= 0 ? ( tph6 ) : -( tph6 )) ;
    if (posti2_ .nprint == 1) {
	s_wsfe(&io___3443);
	do_fio(&c__1, (char *)&tphx, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&sdpx, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&tphz, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&sdpz, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&tph6, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&sdp6, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&qwc[0], (ftnlen)sizeof(doublereal));
	d__1 = tphx - qwc[0];
	do_fio(&c__1, (char *)&d__1, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&qwc[1], (ftnlen)sizeof(doublereal));
	d__2 = tphz - qwc[1];
	do_fio(&c__1, (char *)&d__2, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&qwc[2], (ftnlen)sizeof(doublereal));
	d__3 = tph6 - qwc[2];
	do_fio(&c__1, (char *)&d__3, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& postr_ .dres, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& posti1_ .ires, (ftnlen)sizeof(integer));
	e_wsfe();
    }
    sumda[2] = qwc[0];
    sumda[3] = qwc[1];
    if ((( tphx ) >= 0 ? ( tphx ) : -( tphx ))  > 1e-17) {
	sumda[11] = tphx - qwc[0];
    } else {
	sumda[11] = 0.;
    }
    sumda[12] = sdpx;
    if ((( tphz ) >= 0 ? ( tphz ) : -( tphz ))  > 1e-17) {
	sumda[13] = tphz - qwc[1];
    } else {
	sumda[13] = 0.;
    }
    sumda[14] = sdpz;
    sumda[24] = tph6;
 
    for (i__ = 1; i__ <= 21; ++i__) {
	for (j = 1; j <= 21; ++j) {
	    im1 = i__ - 1;
	    jm1 = j - 1;
	    if (im1 == 0 && jm1 == 0) {
		goto L370;
	    }
	    if (im1 + jm1 > posti1_ .ires) {
		goto L370;
	    }
	    ares = im1 * tphx + jm1 * tphz;
	    dares = d_nint(&ares);
	    ares -= dares;
	    if ((( ares ) >= 0 ? ( ares ) : -( ares ))  < armin) {
		armin = (( ares ) >= 0 ? ( ares ) : -( ares )) ;
		im1s = im1;
		jm1s = jm1;
	    }
	    ared = im1 * tphx - jm1 * tphz;
	    dared = d_nint(&ared);
	    ared -= dared;
	    if ((( ared ) >= 0 ? ( ared ) : -( ared ))  < armin) {
		armin = (( ared ) >= 0 ? ( ared ) : -( ared )) ;
		im1s = im1;
		jm1s = -jm1;
	    }
	    if ((( ares ) >= 0 ? ( ares ) : -( ares ))  < postr_ .dres && posti2_ .nprint == 1) {
		s_wsfe(&io___3452);
		do_fio(&c__1, (char *)&im1, (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)&jm1, (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)&dares, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)&ares, (ftnlen)sizeof(doublereal));
		e_wsfe();
	    }
	    if ((( ared ) >= 0 ? ( ared ) : -( ared ))  < postr_ .dres && jm1 != 0 && im1 != 0 && 
		    posti2_ .nprint == 1) {
		s_wsfe(&io___3453);
		do_fio(&c__1, (char *)&im1, (ftnlen)sizeof(integer));
		i__1 = -jm1;
		do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)&dared, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)&ared, (ftnlen)sizeof(doublereal));
		e_wsfe();
	    }
L370:
	    ;
	}
    }
    if (armin < armin0) {
	sumda[15] = (doublereal) im1s;
	sumda[16] = (doublereal) jm1s;
	sumda[17] = sumda[15] + (( sumda[16] ) >= 0 ? ( sumda[16] ) : -( sumda[16] )) ;
    }
    if (iwarx == 1 && posti2_ .nprint == 1) {
	s_wsfe(&io___3454);
	e_wsfe();
    }
    if (iwarz == 1 && posti2_ .nprint == 1) {
	s_wsfe(&io___3455);
	e_wsfe();
    }
 
L380:
    ++ifp;
    ife = pow_ii(&c__2, &ifp);
    if (ife <= i11 && ife <= nfft) {
	goto L380;
    } else {
	--ifp;
	ife /= 2;
    }
    if (ife == 0) {
	s_wsle(&io___3457);
	do_lio(&c__9, &c__1, "** ERROR ** - IFE IS ZERO", 25L);
	e_wsle();
	goto L550;
    }
    dife = (doublereal) ife;
    if (ifp > 1) {
	if (posti2_ .nprint == 1) {
	    s_wsfe(&io___3459);
	    do_fio(&c__1, (char *)&ife, (ftnlen)sizeof(integer));
	    d__1 = postr_ .dfft * 100;
	    do_fio(&c__1, (char *)&d__1, (ftnlen)sizeof(doublereal));
	    e_wsfe();
	}
	fft_(xxr, xxi, &ifp, &ife);
	fft_(zzr, zzi, &ifp, &ife);
	xxmax = 0.;
	zzmax = 0.;
	xxmin = 1.;
	zzmin = 1.;
	if (posti1_ .ifh == 0) {
	    if1 = 1;
	    if2 = ife;
	    ife2 = ife;
	    pmin[20] = postr_ .qx0;
	    pmax[20] = postr_ .qx0 + 1.;
	    pmin[22] = postr_ .qz0;
	    pmax[22] = postr_ .qz0 + 1.;
	} else if (posti1_ .ifh == 1) {
	    if1 = 1;
	    if2 = ife / 2;
	    ife2 = ife / 2;
	    pmin[20] = postr_ .qx0;
	    pmax[20] = postr_ .qx0 + .5;
	    pmin[22] = postr_ .qz0;
	    pmax[22] = postr_ .qz0 + .5;
	} else {
	    if1 = ife / 2 + 1;
	    if2 = ife;
	    ife2 = ife / 2;
	    pmin[20] = postr_ .qx0 + .5;
	    pmax[20] = postr_ .qx0 + 1.;
	    pmin[22] = postr_ .qz0 + .5;
	    pmax[22] = postr_ .qz0 + 1.;
	}
	i__1 = if2;
	for (i__ = if1; i__ <= i__1; ++i__) {
 
 
	    d__3 = xxr[i__ - 1];
 
	    d__4 = xxi[i__ - 1];
	    d__1 = xxmax, d__2 = sqrt(d__3 * d__3 + d__4 * d__4);
	    xxmax = (( d__1 ) >= ( d__2 ) ? ( d__1 ) : ( d__2 )) ;
 
 
	    d__3 = zzr[i__ - 1];
 
	    d__4 = zzi[i__ - 1];
	    d__1 = zzmax, d__2 = sqrt(d__3 * d__3 + d__4 * d__4);
	    zzmax = (( d__1 ) >= ( d__2 ) ? ( d__1 ) : ( d__2 )) ;
 
 
	    d__3 = xxr[i__ - 1];
 
	    d__4 = xxi[i__ - 1];
	    d__1 = xxmin, d__2 = sqrt(d__3 * d__3 + d__4 * d__4);
	    xxmin = (( d__1 ) <= ( d__2 ) ? ( d__1 ) : ( d__2 )) ;
 
 
	    d__3 = zzr[i__ - 1];
 
	    d__4 = zzi[i__ - 1];
	    d__1 = zzmin, d__2 = sqrt(d__3 * d__3 + d__4 * d__4);
	    zzmin = (( d__1 ) <= ( d__2 ) ? ( d__1 ) : ( d__2 )) ;
 
	}
	if ((( xxmax ) >= 0 ? ( xxmax ) : -( xxmax ))  > 1e-17) {
	    xxmin /= xxmax;
	}
	if ((( zzmax ) >= 0 ? ( zzmax ) : -( zzmax ))  > 1e-17) {
	    zzmin /= zzmax;
	}
	if (xxmax <= 1e-17) {
	    s_wsle(&io___3467);
	    do_lio(&c__9, &c__1, "WARNING: XXMAX IS SET TO : ", 27L);
	    do_lio(&c__5, &c__1, (char *)&c_b8515, (ftnlen)sizeof(doublereal))
		    ;
	    e_wsle();
	    xxmax = 1e-17;
	}
	if (zzmax <= 1e-17) {
	    s_wsle(&io___3468);
	    do_lio(&c__9, &c__1, "WARNING: ZZMAX IS SET TO : ", 27L);
	    do_lio(&c__5, &c__1, (char *)&c_b8515, (ftnlen)sizeof(doublereal))
		    ;
	    e_wsle();
	    zzmax = 1e-17;
	}
	i__1 = if2;
	for (i__ = if1; i__ <= i__1; ++i__) {
 
	    d__1 = xxr[i__ - 1];
 
	    d__2 = xxi[i__ - 1];
	    xxaux = sqrt(d__1 * d__1 + d__2 * d__2);
 
	    d__1 = zzr[i__ - 1];
 
	    d__2 = zzi[i__ - 1];
	    zzaux = sqrt(d__1 * d__1 + d__2 * d__2);
	    if ((d__1 = xxaux - xxmax, (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
		ffx = (i__ - 1) / dife + postr_ .qx0;
	    }
	    if ((d__1 = zzaux - zzmax, (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
		ffz = (i__ - 1) / dife + postr_ .qz0;
	    }
	    xxaux /= xxmax;
	    zzaux /= zzmax;
	    if (xxaux > postr_ .dfft && posti2_ .nprint == 1) {
		s_wsfe(&io___3473);
		d__1 = (i__ - 1) / dife + postr_ .qx0;
		do_fio(&c__1, (char *)&d__1, (ftnlen)sizeof(doublereal));
		d__2 = xxaux * 100;
		do_fio(&c__1, (char *)&d__2, (ftnlen)sizeof(doublereal));
		e_wsfe();
	    }
	    if (zzaux > postr_ .dfft && posti2_ .nprint == 1) {
		s_wsfe(&io___3474);
		d__1 = (i__ - 1) / dife + postr_ .qz0;
		do_fio(&c__1, (char *)&d__1, (ftnlen)sizeof(doublereal));
		d__2 = zzaux * 100;
		do_fio(&c__1, (char *)&d__2, (ftnlen)sizeof(doublereal));
		e_wsfe();
	    }
 
	}
	if (posti2_ .nprint == 1) {
	    s_wsfe(&io___3475);
	    do_fio(&c__1, (char *)&ffx, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&ffz, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&qwc[0], (ftnlen)sizeof(doublereal));
	    d__1 = ffx - qwc[0];
	    do_fio(&c__1, (char *)&d__1, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&qwc[1], (ftnlen)sizeof(doublereal));
	    d__2 = ffz - qwc[1];
	    do_fio(&c__1, (char *)&d__2, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& postr_ .dres, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& posti1_ .ires, (ftnlen)sizeof(integer));
	    e_wsfe();
	}
 
	for (i__ = 1; i__ <= 21; ++i__) {
	    for (j = 1; j <= 21; ++j) {
		im1 = i__ - 1;
		jm1 = j - 1;
		if (im1 == 0 && jm1 == 0) {
		    goto L410;
		}
		if (im1 + jm1 > posti1_ .ires) {
		    goto L410;
		}
		ares = im1 * ffx + jm1 * ffz;
		dares = d_nint(&ares);
		ares -= dares;
		ared = im1 * ffx - jm1 * ffz;
		dared = d_nint(&ared);
		ared -= dared;
		if ((( ares ) >= 0 ? ( ares ) : -( ares ))  < postr_ .dres && posti2_ .nprint == 1) {
		    s_wsfe(&io___3476);
		    do_fio(&c__1, (char *)&im1, (ftnlen)sizeof(integer));
		    do_fio(&c__1, (char *)&jm1, (ftnlen)sizeof(integer));
		    do_fio(&c__1, (char *)&dares, (ftnlen)sizeof(doublereal));
		    do_fio(&c__1, (char *)&ares, (ftnlen)sizeof(doublereal));
		    e_wsfe();
		}
		if ((( ared ) >= 0 ? ( ared ) : -( ared ))  < postr_ .dres && jm1 != 0 && im1 != 0 && 
			posti2_ .nprint == 1) {
		    s_wsfe(&io___3477);
		    do_fio(&c__1, (char *)&im1, (ftnlen)sizeof(integer));
		    i__1 = -jm1;
		    do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer));
		    do_fio(&c__1, (char *)&dared, (ftnlen)sizeof(doublereal));
		    do_fio(&c__1, (char *)&ared, (ftnlen)sizeof(doublereal));
		    e_wsfe();
		}
L410:
		;
	    }
	}
    }
 
    if (posti2_ .nprint == 1) {
	s_wsfe(&io___3478);
	do_fio(&c__1, (char *)&emi, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&emii, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&emiii, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&angi, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&angii, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&angiii, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&evxm, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&sevx, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&evxma, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&evxmi, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&evzm, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&sevz, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&evzma, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&evzmi, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&evtm, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&sevt, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&evtma, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&evtmi, (ftnlen)sizeof(doublereal));
	e_wsfe();
    }
 
    ampx0 = sqrt(bet0[0] * emx0);
    ampz0 = sqrt(bet0[1] * emz0);
    if (posti2_ .nprint == 1) {
	s_wsfe(&io___3481);
	do_fio(&c__1, (char *)&emx0, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&ampx0, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&emz0, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&ampz0, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&emxa, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&emxs, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&emax, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&emix, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&emza, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&emzs, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&emaz, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&emiz, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&emta, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&emts, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&emat, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&emit, (ftnlen)sizeof(doublereal));
	e_wsfe();
    }
    sumda[45] = emi;
    sumda[46] = emii;
    sumda[47] = bet0x2;
    sumda[48] = bet0z2;
    sumda[6] = sqrt(bet0[0] * emi) + sqrt(bet0x2 * emii);
    sumda[7] = sqrt(bet0[1] * emii) + sqrt(bet0z2 * emi);
    sumda[25] = sqrt(bet0[0] * evx2) + sqrt(bet0x2 * evz2);
    sumda[26] = sqrt(bet0[1] * evz2) + sqrt(bet0z2 * evx2);
    sumda[18] = sevx;
    sumda[19] = sevz;
    sumda[20] = sevt;
    sumda[58] = dmmac;
    sumda[59] = dnms;
    sumda[23] = dizu0;
    emax = emax / 100 * emxa + emxa;
    emix = emix / 100 * emxa + emxa;
    emaz = emaz / 100 * emza + emza;
    emiz = emiz / 100 * emza + emza;
    sumda[27] = sqrt(bet0[0] * emix);
    sumda[28] = sqrt(bet0[0] * emxa);
    sumda[29] = sqrt(bet0[0] * emax);
    sumda[30] = sqrt(bet0[1] * emiz);
    sumda[31] = sqrt(bet0[1] * emza);
    sumda[32] = sqrt(bet0[1] * emaz);
    evxma = evxma / 100 * evxm + evxm;
    evxmi = evxmi / 100 * evxm + evxm;
    evzma = evzma / 100 * evzm + evzm;
    evzmi = evzmi / 100 * evzm + evzm;
    sumda[33] = sqrt(bet0[0] * evxmi);
    sumda[34] = sqrt(bet0[0] * evxm);
    sumda[35] = sqrt(bet0[0] * evxma);
    sumda[36] = sqrt(bet0[1] * evzmi);
    sumda[37] = sqrt(bet0[1] * evzm);
    sumda[38] = sqrt(bet0[1] * evzma);
    evtma = evtma / 100 * evtm + evtm;
    evtmi = evtmi / 100 * evtm + evtm;
    if ((d__1 = evxm + evzm, (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
	ratemx = evxm / (evxm + evzm);
	ratemz = evzm / (evxm + evzm);
    } else {
	ratemx = 0.;
	ratemz = 0.;
    }
    sumda[39] = sqrt(bet0[0] * evtmi * ratemx);
    sumda[40] = sqrt(bet0[0] * evtm * ratemx);
    sumda[41] = sqrt(bet0[0] * evtma * ratemx);
    sumda[42] = sqrt(bet0[1] * evtmi * ratemz);
    sumda[43] = sqrt(bet0[1] * evtm * ratemz);
    sumda[44] = sqrt(bet0[1] * evtma * ratemz);
 
    ierro = s_wsle(&io___3484);
    if (ierro != 0) {
	goto L100122;
    }
    for (i__ = 1; i__ <= 60; ++i__) {
	ierro = do_lio(&c__5, &c__1, (char *)&sumda[i__ - 1], (ftnlen)sizeof(
		doublereal));
	if (ierro != 0) {
	    goto L100122;
	}
    }
    ierro = e_wsle();
L100122:
    if (ierro != 0) {
	s_wsle(&io___3485);
	e_wsle();
	s_wsle(&io___3486);
	do_lio(&c__9, &c__1, "*** ERROR ***,PROBLEMS WRITTING TO FILE # : ", 
		44L);
	do_lio(&c__3, &c__1, (char *)&c__10, (ftnlen)sizeof(integer));
	e_wsle();
	s_wsle(&io___3487);
	do_lio(&c__9, &c__1, "ERROR CODE : ", 13L);
	do_lio(&c__3, &c__1, (char *)&ierro, (ftnlen)sizeof(integer));
	e_wsle();
	s_wsle(&io___3488);
	e_wsle();
    }
 
    for (i__ = 1; i__ <= 1000; ++i__) {
	if (invx[i__ - 1] > 0) {
	    ++nuix;
	    xing += xinv[i__ - 1] / invx[i__ - 1];
	}
	if (invz[i__ - 1] > 0) {
	    ++nuiz;
	    zing += zinv[i__ - 1] / invz[i__ - 1];
	}
 
    }
    pinx = (doublereal) nuix;
    pinz = (doublereal) nuiz;
    if (nuix != 0) {
	pixr = (doublereal) nuez / (doublereal) nuix;
	xing /= nuix;
    }
    if (nuiz != 0) {
	pizr = (doublereal) nuex / (doublereal) nuiz;
	zing /= nuiz;
    }
    pinx = pinx / 1000 * 100;
    pinz = pinz / 1000 * 100;
    if (posti2_ .nprint == 1) {
	s_wsfe(&io___3489);
	e_wsfe();
    }
    if (nuez < 1000 && posti2_ .nprint == 1) {
	s_wsfe(&io___3490);
	do_fio(&c__1, (char *)&nuez, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)&c__1000, (ftnlen)sizeof(integer));
	e_wsfe();
    }
    if (nuex < 1000 && posti2_ .nprint == 1) {
	s_wsfe(&io___3491);
	do_fio(&c__1, (char *)&nuex, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)&c__1000, (ftnlen)sizeof(integer));
	e_wsfe();
    }
    if (posti2_ .nprint == 1) {
	s_wsfe(&io___3492);
	do_fio(&c__1, (char *)&nuez, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)&nuix, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)&nuex, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)&nuiz, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)&c__1000, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)&pinx, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&pixr, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&pinz, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&pizr, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&xing, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&zing, (ftnlen)sizeof(doublereal));
	e_wsfe();
    }
 

 
 

    pmin[0] = 0.;
    pmax[0] = (doublereal) ia;
    pmin[6] = pmin[2];
    pmax[6] = pmax[2];
    pmin[7] = pmin[4];
    pmax[7] = pmax[4];
    pmin[10] = pmin[2];
    pmax[10] = pmax[2];
    pmin[11] = pmin[9];
    pmax[11] = pmax[9];
    pmin[12] = pmin[4];
    pmax[12] = pmax[4];
    pmin[13] = pmin[9];
    pmax[13] = pmax[9];
    pmax[14] = (doublereal) ia;
    pmin[16] = pmin[2];
    pmax[16] = pmax[2];
    pmin[17] = pmin[3];
    pmax[17] = pmax[3];
    pmin[18] = pmin[4];
    pmax[18] = pmax[4];
    pmin[19] = pmin[5];
    pmax[19] = pmax[5];
    pmin[21] = 0.;
    pmin[23] = 0.;
    pmax[21] = 1.;
    pmax[23] = 1.;
    for (i__ = 1; i__ <= 12; ++i__) {
	i2 = i__ << 1;
	i1 = i2 - 1;
	if (pmin[i1 - 1] > pmax[i1 - 1]) {
	    pmin[i1 - 1] = pmax[i1 - 1];
	}
	if (pmin[i2 - 1] > pmax[i2 - 1]) {
	    pmin[i2 - 1] = pmax[i2 - 1];
	}
	if ((d__1 = pmin[i1 - 1] - pmax[i1 - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= pieni2 || (
		d__2 = pmin[i2 - 1] - pmax[i2 - 1], (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) ) <= pieni2) {
	    goto L500;
	}
	i__1 = i2;
	for (i3 = i1; i3 <= i__1; ++i3) {
	    pcha = (pmax[i3 - 1] - pmin[i3 - 1]) * prec;
	    pmin[i3 - 1] -= pcha;
	    pmax[i3 - 1] += pcha;
 
	}
	if (posti2_ .iffw == 2) {
	    pmin[21] = xxmin / ((( prec ) >= 0 ? ( prec ) : -( prec ))  + 1.);
	    pmin[23] = zzmin / ((( prec ) >= 0 ? ( prec ) : -( prec ))  + 1.);
	}
	if (i__ == 1 && posti2_ .idis == 1 || i__ > 1 && i__ <= 8 && 
		posti2_ .icow == 1 || (i__ == 9 || i__ == 10) && 
		posti2_ .istw == 1 && (pmin[i1 - 1] != pmax[i1 - 1] && pmin[
		i2 - 1] != pmax[i2 - 1])) {
 
	    htitle_(title + (i__ - 1) * 80, 80L);
	    hbook2_(&i__, " ", &c__2, &pmin[i1 - 1], &pmax[i1 - 1], &c__2, &
		    pmin[i2 - 1], &pmax[i2 - 1], &c_b251, 1L);
	    hplot_(&i__, " ", " ", &c__0, 1L, 1L);
	    hplax_(chxtit + (i__ - 1) * 80, chytit + (i__ - 1) * 80, 80L, 80L)
		    ;
	    hplsof_(&c_b2415, &c_b8642, posti3_ .toptit, &c_b5817, &c_b251, &
		    c_b8645, &c_n1, 80L);
	    hplsof_(&c_b2415, &c_b8648, posti3_ .toptit + 80, &c_b5817, &
		    c_b251, &c_b8645, &c_n1, 80L);
	    hplsof_(&c_b2415, &c_b8654, posti3_ .toptit + 160, &c_b5817, &
		    c_b251, &c_b8645, &c_n1, 80L);
	    hplsof_(&c_b2415, &c_b8660, posti3_ .toptit + 240, &c_b5817, &
		    c_b251, &c_b8645, &c_n1, 80L);
	    iselnt_(&c__10);
	    al__1.aerr = 0;
	    al__1.aunit = *nfile;
	    f_rew(&al__1);
	    io___3495.ciunit = *nfile;
	    ierro = s_rsue(&io___3495);
	    if (ierro != 0) {
		goto L100123;
	    }
	    ierro = e_rsue();
L100123:
	    if (ierro > 0) {
		s_wsfe(&io___3496);
		do_fio(&c__1, (char *)&(*nfile), (ftnlen)sizeof(integer));
		e_wsfe();
		goto L550;
	    }
	    iskc = -1;
	    i__1 = i11 * postr_ .iskip + postr_ .nstart;
	    for (j = 1; j <= i__1; ++j) {
		ifipa = 0;
		if (ntwin == 1) {
		    io___3497.ciunit = *nfile;
		    ierro = s_rsue(&io___3497);
		    if (ierro != 0) {
			goto L100124;
		    }
		    ierro = do_uio(&c__1, (char *)&ia, (ftnlen)sizeof(integer)
			    );
		    if (ierro != 0) {
			goto L100124;
		    }
		    ierro = do_uio(&c__1, (char *)&ifipa, (ftnlen)sizeof(
			    integer));
		    if (ierro != 0) {
			goto L100124;
		    }
		    ierro = do_uio(&c__1, (char *)&b, (ftnlen)sizeof(
			    doublereal));
		    if (ierro != 0) {
			goto L100124;
		    }
		    ierro = do_uio(&c__1, (char *)&c__, (ftnlen)sizeof(
			    doublereal));
		    if (ierro != 0) {
			goto L100124;
		    }
		    ierro = do_uio(&c__1, (char *)&d__, (ftnlen)sizeof(
			    doublereal));
		    if (ierro != 0) {
			goto L100124;
		    }
		    ierro = do_uio(&c__1, (char *)&e, (ftnlen)sizeof(
			    doublereal));
		    if (ierro != 0) {
			goto L100124;
		    }
		    ierro = do_uio(&c__1, (char *)&f, (ftnlen)sizeof(
			    doublereal));
		    if (ierro != 0) {
			goto L100124;
		    }
		    ierro = do_uio(&c__1, (char *)&g, (ftnlen)sizeof(
			    doublereal));
		    if (ierro != 0) {
			goto L100124;
		    }
		    ierro = do_uio(&c__1, (char *)&h__, (ftnlen)sizeof(
			    doublereal));
		    if (ierro != 0) {
			goto L100124;
		    }
		    ierro = do_uio(&c__1, (char *)&p, (ftnlen)sizeof(
			    doublereal));
		    if (ierro != 0) {
			goto L100124;
		    }
		    ierro = e_rsue();
L100124:
		    if (ierro < 0) {
			goto L470;
		    }
		}
		if (ntwin == 2) {
		    io___3498.ciunit = *nfile;
		    ierro = s_rsue(&io___3498);
		    if (ierro != 0) {
			goto L100125;
		    }
		    ierro = do_uio(&c__1, (char *)&ia, (ftnlen)sizeof(integer)
			    );
		    if (ierro != 0) {
			goto L100125;
		    }
		    ierro = do_uio(&c__1, (char *)&ifipa, (ftnlen)sizeof(
			    integer));
		    if (ierro != 0) {
			goto L100125;
		    }
		    ierro = do_uio(&c__1, (char *)&b, (ftnlen)sizeof(
			    doublereal));
		    if (ierro != 0) {
			goto L100125;
		    }
		    ierro = do_uio(&c__1, (char *)&c__, (ftnlen)sizeof(
			    doublereal));
		    if (ierro != 0) {
			goto L100125;
		    }
		    ierro = do_uio(&c__1, (char *)&d__, (ftnlen)sizeof(
			    doublereal));
		    if (ierro != 0) {
			goto L100125;
		    }
		    ierro = do_uio(&c__1, (char *)&e, (ftnlen)sizeof(
			    doublereal));
		    if (ierro != 0) {
			goto L100125;
		    }
		    ierro = do_uio(&c__1, (char *)&f, (ftnlen)sizeof(
			    doublereal));
		    if (ierro != 0) {
			goto L100125;
		    }
		    ierro = do_uio(&c__1, (char *)&g, (ftnlen)sizeof(
			    doublereal));
		    if (ierro != 0) {
			goto L100125;
		    }
		    ierro = do_uio(&c__1, (char *)&h__, (ftnlen)sizeof(
			    doublereal));
		    if (ierro != 0) {
			goto L100125;
		    }
		    ierro = do_uio(&c__1, (char *)&p, (ftnlen)sizeof(
			    doublereal));
		    if (ierro != 0) {
			goto L100125;
		    }
		    ierro = do_uio(&c__1, (char *)&ilapa, (ftnlen)sizeof(
			    integer));
		    if (ierro != 0) {
			goto L100125;
		    }
		    ierro = do_uio(&c__1, (char *)&b, (ftnlen)sizeof(
			    doublereal));
		    if (ierro != 0) {
			goto L100125;
		    }
		    ierro = do_uio(&c__1, (char *)&c1, (ftnlen)sizeof(
			    doublereal));
		    if (ierro != 0) {
			goto L100125;
		    }
		    ierro = do_uio(&c__1, (char *)&d1, (ftnlen)sizeof(
			    doublereal));
		    if (ierro != 0) {
			goto L100125;
		    }
		    ierro = do_uio(&c__1, (char *)&e1, (ftnlen)sizeof(
			    doublereal));
		    if (ierro != 0) {
			goto L100125;
		    }
		    ierro = do_uio(&c__1, (char *)&f1, (ftnlen)sizeof(
			    doublereal));
		    if (ierro != 0) {
			goto L100125;
		    }
		    ierro = do_uio(&c__1, (char *)&g1, (ftnlen)sizeof(
			    doublereal));
		    if (ierro != 0) {
			goto L100125;
		    }
		    ierro = do_uio(&c__1, (char *)&h1, (ftnlen)sizeof(
			    doublereal));
		    if (ierro != 0) {
			goto L100125;
		    }
		    ierro = do_uio(&c__1, (char *)&p1, (ftnlen)sizeof(
			    doublereal));
		    if (ierro != 0) {
			goto L100125;
		    }
		    ierro = e_rsue();
L100125:
		    if (ierro < 0) {
			goto L470;
		    }
		}
		if (ierro > 0) {
		    s_wsfe(&io___3499);
		    do_fio(&c__1, (char *)&(*nfile), (ftnlen)sizeof(integer));
		    e_wsfe();
		    goto L550;
		}
		if (ifipa < 1) {
		    goto L460;
		}
		++iskc;
		if (iskc % postr_ .iskip != 0) {
		    goto L460;
		}
		if (ia - postr_ .nstart < 0) {
		    goto L460;
		}
		if (s_cmp(progrm, "MAD", 8L, 3L) == 0) {
		    c__ *= 1e3;
		    d__ *= 1e3;
		    e *= 1e3;
		    f *= 1e3;
		    g *= 1e3;
		    p *= 1e3;
		    if (ntwin == 2) {
			c1 *= 1e3;
			d1 *= 1e3;
			e1 *= 1e3;
			f1 *= 1e3;
			g1 *= 1e3;
			p1 *= 1e3;
		    }
		}
 
		if (ntwin == 2) {
		    x[0] = c__;
		    x[2] = d__;
		    x[4] = e;
		    x[6] = f;
		    x[8] = g;
		    x[10] = h__;
		    x[1] = c1;
		    x[3] = d1;
		    x[5] = e1;
		    x[7] = f1;
		    x[9] = g1;
		    x[11] = h1;
		    distance_(x, cloau, di0au, t, &b);
		}
		if (cor_ .icode >= 4 && cor_ .its6d == 0) {
		    c__ -= di0[0] * h__;
		    d__ -= dip0[0] * h__;
		    e -= di0[1] * h__;
		    f -= dip0[1] * h__;
		}
		c__ -= clo[0];
		d__ -= clop[0];
		e -= clo[1];
		f -= clop[1];
		g -= clo[2];
		h__ -= clop[2];
		xyzv[0] = c__;
		xyzv[1] = d__;
		xyzv[2] = e;
		xyzv[3] = f;
		xyzv[4] = g;
		xyzv[5] = h__;
 
		if (cor_ .its6d == 1) {
		    xyzv[1] *= xyzv[5] + 1. + clop[2];
		    xyzv[3] *= xyzv[5] + 1. + clop[2];
		}
		for (iq = 1; iq <= 6; ++iq) {
		    txyz[iq - 1] = 0.;
		    for (jq = 1; jq <= 6; ++jq) {
			txyz[iq - 1] += t[jq + iq * 6 - 7] * xyzv[jq - 1];
 
		    }
		}
		for (iq = 1; iq <= 6; ++iq) {
		    txyz[iq - 1] *= rbeta[iq - 1];
 
		}
		c__ = txyz[0];
		d__ = txyz[1];
		e = txyz[2];
		f = txyz[3];
		g = txyz[4] * postr_ .cma2;
		h__ = txyz[5] * postr_ .cma1;
		if (posti2_ .istw == 1 && (i__ == 9 || i__ == 10)) {
		    if (i__ == 9) {
			caconv_(&dpz, &f, &e);
		    }
		    if (i__ == 10) {
			caconv_(&dpx, &d__, &c__);
		    }
		}
L460:
		;
	    }
L470:
	    ;
	} else if ((posti2_ .iffw == 1 || posti2_ .iffw == 2) && (i__ == 11 ||
		 i__ == 12)) {
 
	    htitle_(title + (i__ - 1) * 80, 80L);
	    hbook2_(&i__, " ", &c__2, &pmin[i1 - 1], &pmax[i1 - 1], &c__2, &
		    pmin[i2 - 1], &pmax[i2 - 1], &c_b251, 1L);
	    if (posti2_ .iffw == 2) {
		hplopt_("LOGY", &c__1, 4L);
	    }
	    hplot_(&i__, " ", " ", &c__0, 1L, 1L);
	    hplax_(chxtit + (i__ - 1) * 80, chytit + (i__ - 1) * 80, 80L, 80L)
		    ;
	    hplsof_(&c_b2415, &c_b8642, posti3_ .toptit, &c_b5817, &c_b251, &
		    c_b8645, &c_n1, 80L);
	    hplsof_(&c_b2415, &c_b8648, posti3_ .toptit + 80, &c_b5817, &
		    c_b251, &c_b8645, &c_n1, 80L);
	    hplsof_(&c_b2415, &c_b8654, posti3_ .toptit + 160, &c_b5817, &
		    c_b251, &c_b8645, &c_n1, 80L);
	    hplsof_(&c_b2415, &c_b8660, posti3_ .toptit + 240, &c_b5817, &
		    c_b251, &c_b8645, &c_n1, 80L);
	    iselnt_(&c__10);
	    if (i__ == 11) {
		i__1 = if2;
		for (k = if1; k <= i__1; ++k) {
		    k1 = k - if1 + 1;
 
		    d__1 = xxr[k - 1];
 
		    d__2 = xxi[k - 1];
		    xxaux = sqrt(d__1 * d__1 + d__2 * d__2);
		    xxaux /= xxmax;
		    fxs[k1 - 1] = (k - 1) / dife + postr_ .qx0;
		    if (posti2_ .iffw == 2) {
			if ((( xxaux ) >= 0 ? ( xxaux ) : -( xxaux ))  < 1e-17) {
			    s_wsle(&io___3502);
			    do_lio(&c__9, &c__1, "* * * ERROR * * *", 17L);
			    e_wsle();
			    s_wsle(&io___3503);
			    do_lio(&c__9, &c__1, "Apparently horizontal FFT data are corrupted", 44L);
			    e_wsle();
			    xxaux = 1e-17;
			}
			fzs[k1 - 1] = d_lg10(&xxaux);
		    } else {
			fzs[k1 - 1] = xxaux;
		    }
		    if (posti2_ .nprint == 1) {
			ierro = s_wsfe(&io___3504);
			if (ierro != 0) {
			    goto L100126;
			}
			ierro = do_fio(&c__1, (char *)&fxs[k1 - 1], (ftnlen)
				sizeof(doublereal));
			if (ierro != 0) {
			    goto L100126;
			}
			ierro = do_fio(&c__1, (char *)&fzs[k1 - 1], (ftnlen)
				sizeof(doublereal));
			if (ierro != 0) {
			    goto L100126;
			}
			ierro = e_wsfe();
L100126:
			if (ierro != 0) {
			    s_wsle(&io___3505);
			    e_wsle();
			    s_wsle(&io___3506);
			    do_lio(&c__9, &c__1, "*** ERROR ***,PROBLEMS WRITTING TO FILE # : ", 44L);
			    do_lio(&c__3, &c__1, (char *)&c__14, (ftnlen)
				    sizeof(integer));
			    e_wsle();
			    s_wsle(&io___3507);
			    do_lio(&c__9, &c__1, "ERROR CODE : ", 13L);
			    do_lio(&c__3, &c__1, (char *)&ierro, (ftnlen)
				    sizeof(integer));
			    e_wsle();
			    s_wsle(&io___3508);
			    e_wsle();
			}
		    }
 
		}
		ipl_(&ife2, fxs, fzs);
	    } else if (i__ == 12) {
		i__1 = if2;
		for (k = if1; k <= i__1; ++k) {
		    k1 = k - if1 + 1;
 
		    d__1 = zzr[k - 1];
 
		    d__2 = zzi[k - 1];
		    zzaux = sqrt(d__1 * d__1 + d__2 * d__2);
		    zzaux /= zzmax;
		    fxs[k1 - 1] = (k - 1) / dife + postr_ .qz0;
		    if (posti2_ .iffw == 2) {
			if ((( zzaux ) >= 0 ? ( zzaux ) : -( zzaux ))  < 1e-17) {
			    s_wsle(&io___3509);
			    do_lio(&c__9, &c__1, "* * * ERROR * * *", 17L);
			    e_wsle();
			    s_wsle(&io___3510);
			    do_lio(&c__9, &c__1, "Apparently vertical FFT data are corrupted", 42L);
			    e_wsle();
			    zzaux = 1e-17;
			}
			fzs[k1 - 1] = d_lg10(&zzaux);
		    } else {
			fzs[k1 - 1] = zzaux;
		    }
		    if (posti2_ .nprint == 1) {
			ierro = s_wsfe(&io___3511);
			if (ierro != 0) {
			    goto L100127;
			}
			ierro = do_fio(&c__1, (char *)&fxs[k1 - 1], (ftnlen)
				sizeof(doublereal));
			if (ierro != 0) {
			    goto L100127;
			}
			ierro = do_fio(&c__1, (char *)&fzs[k1 - 1], (ftnlen)
				sizeof(doublereal));
			if (ierro != 0) {
			    goto L100127;
			}
			ierro = e_wsfe();
L100127:
			if (ierro != 0) {
			    s_wsle(&io___3512);
			    e_wsle();
			    s_wsle(&io___3513);
			    do_lio(&c__9, &c__1, "*** ERROR ***,PROBLEMS WRITTING TO FILE # : ", 44L);
			    do_lio(&c__3, &c__1, (char *)&c__14, (ftnlen)
				    sizeof(integer));
			    e_wsle();
			    s_wsle(&io___3514);
			    do_lio(&c__9, &c__1, "ERROR CODE : ", 13L);
			    do_lio(&c__3, &c__1, (char *)&ierro, (ftnlen)
				    sizeof(integer));
			    e_wsle();
			    s_wsle(&io___3515);
			    e_wsle();
			}
		    }
 
		}
		ipl_(&ife2, fxs, fzs);
	    }
	}
	if (posti2_ .iffw == 2) {
	    hplopt_("LINY", &c__1, 4L);
	}
L500:
	;
    }
    if (posti2_ .idis != 0 || posti2_ .icow != 0 || posti2_ .istw != 0 || 
	    posti2_ .iffw != 0) {
	hdelet_(&c__0);
    }
    goto L560;
L510:
    s_wsfe(&io___3516);
    do_fio(&c__1, (char *)&(*nfile), (ftnlen)sizeof(integer));
    do_fio(&c__1, "HEADER CORRUPTED", 16L);
    e_wsfe();
    goto L550;
L520:
    s_wsfe(&io___3517);
    do_fio(&c__1, (char *)&(*nfile), (ftnlen)sizeof(integer));
    do_fio(&c__1, "HEADER OF MADFILE CORRUPTED", 27L);
    e_wsfe();
    goto L550;
L530:
    s_wsfe(&io___3518);
    do_fio(&c__1, (char *)&(*nfile), (ftnlen)sizeof(integer));
    do_fio(&c__1, "NO DATA", 7L);
    e_wsfe();
    goto L550;
L540:
    s_wsfe(&io___3519);
    do_fio(&c__1, (char *)&(*nfile), (ftnlen)sizeof(integer));
    do_fio(&c__1, "WRONG RANGE OF DATA FOR PROCESSING", 34L);
    e_wsfe();
L550:
    ierro = s_wsle(&io___3520);
    if (ierro != 0) {
	goto L100128;
    }
    for (i__ = 1; i__ <= 60; ++i__) {
	ierro = do_lio(&c__5, &c__1, (char *)&sumda[i__ - 1], (ftnlen)sizeof(
		doublereal));
	if (ierro != 0) {
	    goto L100128;
	}
    }
    ierro = e_wsle();
L100128:
 
L560:
    al__1.aerr = 0;
    al__1.aunit = *nfile;
    f_rew(&al__1);
    al__1.aerr = 0;
    al__1.aunit = 14;
    f_rew(&al__1);
    al__1.aerr = 0;
    al__1.aunit = 15;
    f_rew(&al__1);
 
 

 

    return 0;
 
}  

 
 
  int putorb_(xinc, nx, npflag)
doublereal *xinc;
integer *nx, *npflag;
{
     
    static char fmt_10000[] = "(t5,i4,i4,\002 \002,a16,\002  OLD: \002,d13.7,\002 MRAD   NEW: \002,d13.7,\002 MRAD\002)";

     
    integer i__1, i__2, i__3;
    doublereal d__1, d__2;

     
    integer s_wsfe(), do_fio(), e_wsfe();

     
    static doublereal ckickold, ckicknew;
    static integer i__, j, k;
    static doublereal r0;
    static integer im, ix;
    static doublereal r0a;
    static integer izu, kpz, kzz, nmz, kcorr, kcorru;

     
    static cilist io___3531 = { 0, 6, 0, fmt_10000, 0 };
    static cilist io___3537 = { 0, 6, 0, fmt_10000, 0 };
    static cilist io___3538 = { 0, 6, 0, fmt_10000, 0 };


 

 
 

 

 

     
    --nx;
    --xinc;

     
    kcorru = 0;
    kcorr = 0;
    izu = 0;
    i__1 = str_ .iu;
    for (i__ = 1; i__ <= i__1; ++i__) {
	ix = str_ .ic[i__ - 1];
	if (ix <= 300) {
	    goto L60;
	}
	ix += -300;
	kpz = ell_ .kp[ix - 1];
	kzz = ell_ .kz[ix - 1];
	if (kpz == 6 || kzz == 0) {
	    goto L60;
	}
	if (rand0_ .iorg < 0) {
	    rand0_ .mzu[i__ - 1] = izu;
	}
	izu = rand0_ .mzu[i__ - 1] + 1;
	if (kpz == 4 && kzz == 1 && *npflag == 1 || kpz == -4 && kzz == -1 && 
		*npflag == 2) {
	    ++kcorr;
	    i__2 = clos_ .ncorru;
	    for (j = 1; j <= i__2; ++j) {
		if (nx[j] == kcorr) {
		    ++kcorru;
		    ckickold = ell_ .sm[ix - 1] + rand0_ .zfz[izu - 1] * 
			    ell_ .ek[ix - 1];
		    rand0_ .zfz[izu - 1] += xinc[j] / ell_ .ek[ix - 1];
		    ckicknew = ell_ .sm[ix - 1] + rand0_ .zfz[izu - 1] * 
			    ell_ .ek[ix - 1];
		    s_wsfe(&io___3531);
		    do_fio(&c__1, (char *)&kcorru, (ftnlen)sizeof(integer));
		    do_fio(&c__1, (char *)&kcorr, (ftnlen)sizeof(integer));
		    do_fio(&c__1, linopc_ .bez + (ix - 1 << 4), 16L);
		    d__1 = ckickold * 1e3;
		    do_fio(&c__1, (char *)&d__1, (ftnlen)sizeof(doublereal));
		    d__2 = ckicknew * 1e3;
		    do_fio(&c__1, (char *)&d__2, (ftnlen)sizeof(doublereal));
		    e_wsfe();
		}
 
	    }
	}
	izu += 2;
	if (kzz == 11) {
	    r0 = ell_ .ek[ix - 1];
	    if ((( r0 ) >= 0 ? ( r0 ) : -( r0 ))  <= 1e-17) {
		goto L60;
	    }
	    nmz = mult1_ .nmu[ix - 1];
	    if (nmz == 0) {
		izu += 22;
		goto L60;
	    }
	    im = mult1_ .irm[ix - 1];
	    r0a = 1.;
	    i__2 = nmz;
	    for (k = 1; k <= i__2; ++k) {
		++izu;
		if (kpz == -4 && *npflag == 2 && k == 1) {
		    ++kcorr;
		    i__3 = clos_ .ncorru;
		    for (j = 1; j <= i__3; ++j) {
			if (nx[j] == kcorr) {
			    ++kcorru;
			    ckickold = ell_ .ed[ix - 1] * (multi_ .ak0[im + k 
				    * 700 - 701] + rand0_ .zfz[izu - 1] * 
				    multi_ .aka[im + k * 700 - 701]) / r0a;
			    rand0_ .zfz[izu - 1] += (xinc[j] / (r0a * 
				    ell_ .ed[ix - 1]) - multi_ .ak0[im + k * 
				    700 - 701]) * 1e3 / multi_ .aka[im + k * 
				    700 - 701];
			    ckicknew = ell_ .ed[ix - 1] * (multi_ .ak0[im + k 
				    * 700 - 701] + rand0_ .zfz[izu - 1] * 
				    multi_ .aka[im + k * 700 - 701]) / r0a;
			    s_wsfe(&io___3537);
			    do_fio(&c__1, (char *)&kcorru, (ftnlen)sizeof(
				    integer));
			    do_fio(&c__1, (char *)&kcorr, (ftnlen)sizeof(
				    integer));
			    do_fio(&c__1, linopc_ .bez + (ix - 1 << 4), 16L);
			    do_fio(&c__1, (char *)&ckickold, (ftnlen)sizeof(
				    doublereal));
			    do_fio(&c__1, (char *)&ckicknew, (ftnlen)sizeof(
				    doublereal));
			    e_wsfe();
			}
 
		    }
		}
		++izu;
		if (kpz == 4 && *npflag == 1 && k == 1) {
		    ++kcorr;
		    i__3 = clos_ .ncorru;
		    for (j = 1; j <= i__3; ++j) {
			if (nx[j] == kcorr) {
			    ++kcorru;
			    ckickold = ell_ .ed[ix - 1] * (multi_ .bk0[im + k 
				    * 700 - 701] + rand0_ .zfz[izu - 1] * 
				    multi_ .bka[im + k * 700 - 701]) / r0a;
			    rand0_ .zfz[izu - 1] += (xinc[j] / (r0a * 
				    ell_ .ed[ix - 1]) - multi_ .bk0[im + k * 
				    700 - 701]) * 1e3 / multi_ .bka[im + k * 
				    700 - 701];
			    ckicknew = ell_ .ed[ix - 1] * (multi_ .bk0[im + k 
				    * 700 - 701] + rand0_ .zfz[izu - 1] * 
				    multi_ .bka[im + k * 700 - 701]) / r0a;
			    s_wsfe(&io___3538);
			    do_fio(&c__1, (char *)&kcorru, (ftnlen)sizeof(
				    integer));
			    do_fio(&c__1, (char *)&kcorr, (ftnlen)sizeof(
				    integer));
			    do_fio(&c__1, linopc_ .bez + (ix - 1 << 4), 16L);
			    do_fio(&c__1, (char *)&ckickold, (ftnlen)sizeof(
				    doublereal));
			    do_fio(&c__1, (char *)&ckicknew, (ftnlen)sizeof(
				    doublereal));
			    e_wsfe();
			}
 
		    }
		}
 
	    }
	    izu = izu + 22 - (nmz << 1);
	}
L60:
	;
    }
 

    return 0;
}  

 
 
  int qmod_()
{
     
    static char fmt_10010[] = "(\002 \002/131(\002-\002))";
    static char fmt_10100[] = "(t5,\002---- QMOD FOR SPLIT-Q-VALUES ENTRY ---- \002,\002(ZERO MOMENTUM-DEVIATION)\002)";
    static char fmt_10120[] = "(t10,\002START-QX-QZ-QXH\002,3f12.7,\002 END-QX-QZ-QXH\002,3f12.7)";
    static char fmt_10110[] = "(t5,\002---- QMOD ENTRY ---- (ZERO MOMENTUM-DEVIATION)\002)";
    static char fmt_10130[] = "(t10,\002START-QX-QZ\002,2f12.7,\002 END-QX-QZ\002,2f12.7)";
    static char fmt_10140[] = "(t10,\002ITER=\002,i3,\002/QUAD=\002,i3,\002/QX-QZ-QXH\002,3f12.7)";
    static char fmt_10150[] = "(t10,\002ITER=\002,i3,\002/QUAD=\002,i3,\002/QX-QZ\002,2f12.7)";
    static char fmt_10020[] = "(//131(\002-\002)//t10,\002DATA BLOCK TUNE-VARIATION\002//t10,\002TUNE\002,26x,\002THEORET.     AFTER CORRECTION\002/t10,\002HORIZONTAL\002,17x,g16.10,2x,g16.10/t10,\002VERTICAL\002,19x,g16.10,2x,g16.10/t10,\002PART-HORIZONTAL\002,12x,g16.10,2x,g16.10/)";
    static char fmt_10040[] = "(t10,\002QUADRU.STRENGTHS\002,7x,g16.10,2x,g16.10,\002   TYP     \002,a16/t10,23x,g16.10,2x,g16.10,\002           \002,a16)";
    static char fmt_10080[] = "(t10,\002TOTAL TUNE SHIFT\002,10x,\002QX =\002,f10.7,\002    QZ =\002,f10.7,\002   QXH =\002,f10.7)";
    static char fmt_10060[] = "(t10,\002QUADRUPOLE SENSITIVITIES\002,6x,\002D-QX\002,14x,\002D-QZ\002,14x,\002D-QXH\002/29x,\002QF   \002,d15.8,3x,d15.8,3x,d15.8/29x,\002QD   \002,d15.8,3x,d15.8,3x,d15.8/29x,\002QF2  \002,d15.8,3x,d15.8,3x,d15.8//131(\002-\002)//)";
    static char fmt_10030[] = "(//131(\002-\002)//t10,\002DATA BLOCK TUNE-VARIATION\002//t10,\002TUNE\002,26x,\002THEORET.      AFTER CORRECTION\002/t10,\002HORIZONTAL\002,17x,g16.10,2x,g16.10/t10,\002VERTICAL\002,19x,g16.10,2x,g16.10/)";
    static char fmt_10050[] = "(t10,\002QUADRU.STRENGTHS\002,7x,g16.10,2x,g16.10,\002   TYP     \002,a16/t10,23x,g16.10,2x,g16.10,\002           \002,a16)";
    static char fmt_10090[] = "(t10,\002TOTAL TUNE SHIFT\002,10x,\002QX =\002,f10.7,\002    QZ =\002,f10.7)";
    static char fmt_10070[] = "(t10,\002QUADRUPOLE SENSITIVITIES\002,6x,\002D-QX\002,14x,\002D-QZ\002,/29x,\002QF   \002,d15.8,3x,d15.8/29x,\002QD   \002,d15.8,3x,d15.8//131(\002-\002)//)";
    static char fmt_10000[] = "(t5/t10,\002TUNE ADJUSTMENT\002/t10,\002MAXIMUM NUMBER OF ITERATIONS ACHIEVED--->\002,2x,i4/t10,\002PROCEDURE MAY NOT HAVE CONVERGED\002)";

     
    integer i__1, i__2;
    doublereal d__1, d__2;

     
    integer s_wsfe(), e_wsfe(), do_fio();

     
    static integer i__, j, l, n;
    static doublereal aa[9]	 , a11, bb[3], a12, a21, a22, 
	    a13, a23, a31, a32;
    static integer ii;
    static doublereal a33, qx[3], qz[3], aa1[4]	 , dq1, dq2, 
	    dq3;
    static integer iq1, iq2, iq3;
    static doublereal sm0[3], qwc[3], sqx, sqz, dpp, sens[15]	 
, sqxh;
    static integer nite, iql, ierr;
    extern   int clorb_(), loesd_(), error_(), phasad_(), 
	    combel_();

     
    static cilist io___3549 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___3558 = { 0, 6, 0, fmt_10100, 0 };
    static cilist io___3559 = { 0, 6, 0, fmt_10120, 0 };
    static cilist io___3560 = { 0, 6, 0, fmt_10110, 0 };
    static cilist io___3561 = { 0, 6, 0, fmt_10130, 0 };
    static cilist io___3565 = { 0, 6, 0, fmt_10140, 0 };
    static cilist io___3566 = { 0, 6, 0, fmt_10150, 0 };
    static cilist io___3578 = { 0, 6, 0, fmt_10020, 0 };
    static cilist io___3579 = { 0, 6, 0, fmt_10040, 0 };
    static cilist io___3580 = { 0, 6, 0, fmt_10040, 0 };
    static cilist io___3581 = { 0, 6, 0, fmt_10080, 0 };
    static cilist io___3582 = { 0, 6, 0, fmt_10060, 0 };
    static cilist io___3583 = { 0, 6, 0, fmt_10030, 0 };
    static cilist io___3584 = { 0, 6, 0, fmt_10050, 0 };
    static cilist io___3585 = { 0, 6, 0, fmt_10050, 0 };
    static cilist io___3586 = { 0, 6, 0, fmt_10090, 0 };
    static cilist io___3587 = { 0, 6, 0, fmt_10070, 0 };
    static cilist io___3591 = { 0, 6, 0, fmt_10000, 0 };


 

 
 
 

 

    for (i__ = 1; i__ <= 3; ++i__) {
	bb[i__ - 1] = 0.;
	qx[i__ - 1] = 0.;
	qz[i__ - 1] = 0.;
	sm0[i__ - 1] = 0.;
	qwc[i__ - 1] = 0.;
	for (j = 1; j <= 3; ++j) {
	    aa[i__ + j * 3 - 4] = 0.;
 
	}
    }
    for (i__ = 1; i__ <= 3; ++i__) {
	for (j = 1; j <= 5; ++j) {
	    sens[i__ + j * 3 - 4] = 0.;
 
	}
    }
    for (i__ = 1; i__ <= 2; ++i__) {
	for (j = 1; j <= 2; ++j) {
	    aa1[i__ + (j << 1) - 3] = 0.;
 
	}
    }
    s_wsfe(&io___3549);
    e_wsfe();
    sqx = 0.;
    sqz = 0.;
    sqxh = 0.;
    dpp = 0.;
    iq1 = qmodi_ .iq[0];
    iq2 = qmodi_ .iq[1];
    if (ell_ .kz[iq1 - 1] != 2 || ell_ .kz[iq2 - 1] != 2) {
	error_(&c__8);
    }
    if ((d__1 = ell_ .el[iq1 - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17 || (d__2 = ell_ .el[
	    iq2 - 1], (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) ) <= 1e-17) {
	sm0[0] = ell_ .ed[iq1 - 1];
	sm0[1] = ell_ .ed[iq2 - 1];
    } else {
	sm0[0] = ell_ .ek[iq1 - 1];
	sm0[1] = ell_ .ek[iq2 - 1];
    }
    if (ell_ .kp[iq1 - 1] == 5) {
	combel_(&iq1);
    }
    if (ell_ .kp[iq2 - 1] == 5) {
	combel_(&iq2);
    }
    sens[0] = qmodi_ .qw0[0];
    sens[1] = qmodi_ .qw0[1];
    if ((( qmodi_ .qw0[2] ) >= 0 ? ( qmodi_ .qw0[2] ) : -( qmodi_ .qw0[2] ))  > 1e-17) {
	iq3 = qmodi_ .iq[2];
	if (ell_ .kz[iq3 - 1] != 2) {
	    error_(&c__8);
	}
	if ((d__1 = ell_ .el[iq3 - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    sm0[2] = ell_ .ed[iq3 - 1];
	} else {
	    sm0[2] = ell_ .ek[iq3 - 1];
	}
	if (ell_ .kp[iq3 - 1] == 5) {
	    combel_(&iq3);
	}
	nite = 3;
    } else {
	nite = 2;
    }
    clorb_(&dpp);
    if (erro_ .ierro > 0) {
	error_(&c__9);
    }
    phasad_(&dpp, qwc);
    sens[12] = qwc[0];
    sens[13] = qwc[1];
    if (nite == 3) {
	sens[2] = qmodi_ .qw0[2];
	sens[14] = qwc[2];
	s_wsfe(&io___3558);
	e_wsfe();
	s_wsfe(&io___3559);
	do_fio(&c__3, (char *)&qwc[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__3, (char *)& qmodi_ .qw0[0], (ftnlen)sizeof(doublereal));
	e_wsfe();
    } else {
	s_wsfe(&io___3560);
	e_wsfe();
	s_wsfe(&io___3561);
	do_fio(&c__1, (char *)&qwc[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&qwc[1], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& qmodi_ .qw0[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& qmodi_ .qw0[1], (ftnlen)sizeof(doublereal));
	e_wsfe();
    }
    i__1 = clo_ .itqv;
    for (ii = 1; ii <= i__1; ++ii) {
	i__2 = nite;
	for (n = 1; n <= i__2; ++n) {
	    iql = qmodi_ .iq[n - 1];
	    if ((d__1 = ell_ .el[iql - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
		ell_ .ed[iql - 1] += clo_ .dkq;
	    } else {
		ell_ .ek[iql - 1] += clo_ .dkq;
	    }
	    if (ell_ .kp[iql - 1] == 5) {
		combel_(&iql);
	    }
	    clorb_(&dpp);
	    if (erro_ .ierro > 0) {
		error_(&c__9);
	    }
	    phasad_(&dpp, qwc);
	    sens[(n + 1) * 3 - 3] = qwc[0];
	    sens[(n + 1) * 3 - 2] = qwc[1];
	    if (nite == 3) {
		sens[(n + 1) * 3 - 1] = qwc[2];
		s_wsfe(&io___3565);
		do_fio(&c__1, (char *)&ii, (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
		do_fio(&c__3, (char *)&qwc[0], (ftnlen)sizeof(doublereal));
		e_wsfe();
	    } else {
		s_wsfe(&io___3566);
		do_fio(&c__1, (char *)&ii, (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)&qwc[0], (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)&qwc[1], (ftnlen)sizeof(doublereal));
		e_wsfe();
	    }
	    if ((d__1 = ell_ .el[iql - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
		ell_ .ed[iql - 1] -= clo_ .dkq;
	    } else {
		ell_ .ek[iql - 1] -= clo_ .dkq;
	    }
	    if (ell_ .kp[iql - 1] == 5) {
		combel_(&iql);
	    }
 
	}
 
	aa1[0] = (sens[3] - sens[12]) / clo_ .dkq;
	aa1[2] = (sens[4] - sens[13]) / clo_ .dkq;
	aa1[1] = (sens[6] - sens[12]) / clo_ .dkq;
	aa1[3] = (sens[7] - sens[13]) / clo_ .dkq;
	a11 = aa1[0];
	a12 = aa1[2];
	a21 = aa1[1];
	a22 = aa1[3];
	bb[0] = sens[12] - sens[0];
	bb[1] = sens[13] - sens[1];
	sqx += (( bb[0] ) >= 0 ? ( bb[0] ) : -( bb[0] )) ;
	sqz += (( bb[1] ) >= 0 ? ( bb[1] ) : -( bb[1] )) ;
	if (nite == 3) {
	    aa[0] = a11;
	    aa[3] = a12;
	    aa[6] = (sens[5] - sens[14]) / clo_ .dkq;
	    aa[1] = a21;
	    aa[4] = a22;
	    aa[7] = (sens[8] - sens[14]) / clo_ .dkq;
	    aa[2] = (sens[9] - sens[12]) / clo_ .dkq;
	    aa[5] = (sens[10] - sens[13]) / clo_ .dkq;
	    aa[8] = (sens[11] - sens[14]) / clo_ .dkq;
	    a13 = aa[6];
	    a23 = aa[7];
	    a31 = aa[2];
	    a32 = aa[5];
	    a33 = aa[8];
	    bb[2] = sens[14] - sens[2];
	    sqxh += (( bb[2] ) >= 0 ? ( bb[2] ) : -( bb[2] )) ;
	    loesd_(aa, bb, &nite, &nite, &ierr);
	} else {
	    loesd_(aa1, bb, &nite, &nite, &ierr);
	}
	if (ierr == 1) {
	    error_(&c__35);
	}
	i__2 = nite;
	for (l = 1; l <= i__2; ++l) {
	    iql = qmodi_ .iq[l - 1];
	    if ((d__1 = ell_ .el[iql - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
		ell_ .ed[iql - 1] -= bb[l - 1];
	    } else {
		ell_ .ek[iql - 1] -= bb[l - 1];
	    }
	    if (ell_ .kp[iql - 1] == 5) {
		combel_(&iql);
	    }
 
	}
	clorb_(&dpp);
	if (erro_ .ierro > 0) {
	    error_(&c__9);
	}
	phasad_(&dpp, qwc);
	sens[12] = qwc[0];
	sens[13] = qwc[1];
	if (nite == 3) {
	    sens[14] = qwc[2];
	    s_wsfe(&io___3578);
	    do_fio(&c__1, (char *)& qmodi_ .qw0[0], (ftnlen)sizeof(doublereal))
		    ;
	    do_fio(&c__1, (char *)&qwc[0], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& qmodi_ .qw0[1], (ftnlen)sizeof(doublereal))
		    ;
	    do_fio(&c__1, (char *)&qwc[1], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& qmodi_ .qw0[2], (ftnlen)sizeof(doublereal))
		    ;
	    do_fio(&c__1, (char *)&qwc[2], (ftnlen)sizeof(doublereal));
	    e_wsfe();
	    if ((d__1 = ell_ .el[iq1 - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
		s_wsfe(&io___3579);
		do_fio(&c__1, (char *)&sm0[0], (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& ell_ .ed[iq1 - 1], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, linopc_ .bez + (iq1 - 1 << 4), 16L);
		do_fio(&c__1, (char *)&sm0[1], (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& ell_ .ed[iq2 - 1], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, linopc_ .bez + (iq2 - 1 << 4), 16L);
		do_fio(&c__1, (char *)&sm0[2], (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& ell_ .ed[iq3 - 1], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, linopc_ .bez + (iq3 - 1 << 4), 16L);
		e_wsfe();
	    } else {
		s_wsfe(&io___3580);
		do_fio(&c__1, (char *)&sm0[0], (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& ell_ .ek[iq1 - 1], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, linopc_ .bez + (iq1 - 1 << 4), 16L);
		do_fio(&c__1, (char *)&sm0[1], (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& ell_ .ek[iq2 - 1], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, linopc_ .bez + (iq2 - 1 << 4), 16L);
		do_fio(&c__1, (char *)&sm0[2], (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& ell_ .ek[iq3 - 1], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, linopc_ .bez + (iq3 - 1 << 4), 16L);
		e_wsfe();
	    }
	    s_wsfe(&io___3581);
	    do_fio(&c__1, (char *)&sqx, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&sqz, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&sqxh, (ftnlen)sizeof(doublereal));
	    e_wsfe();
	    s_wsfe(&io___3582);
	    do_fio(&c__1, (char *)&a11, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&a12, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&a13, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&a21, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&a22, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&a23, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&a31, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&a32, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&a33, (ftnlen)sizeof(doublereal));
	    e_wsfe();
	} else {
	    s_wsfe(&io___3583);
	    do_fio(&c__1, (char *)& qmodi_ .qw0[0], (ftnlen)sizeof(doublereal))
		    ;
	    do_fio(&c__1, (char *)&qwc[0], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& qmodi_ .qw0[1], (ftnlen)sizeof(doublereal))
		    ;
	    do_fio(&c__1, (char *)&qwc[1], (ftnlen)sizeof(doublereal));
	    e_wsfe();
	    if ((d__1 = ell_ .el[iq1 - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
		s_wsfe(&io___3584);
		do_fio(&c__1, (char *)&sm0[0], (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& ell_ .ed[iq1 - 1], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, linopc_ .bez + (iq1 - 1 << 4), 16L);
		do_fio(&c__1, (char *)&sm0[1], (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& ell_ .ed[iq2 - 1], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, linopc_ .bez + (iq2 - 1 << 4), 16L);
		e_wsfe();
	    } else {
		s_wsfe(&io___3585);
		do_fio(&c__1, (char *)&sm0[0], (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& ell_ .ek[iq1 - 1], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, linopc_ .bez + (iq1 - 1 << 4), 16L);
		do_fio(&c__1, (char *)&sm0[1], (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)& ell_ .ek[iq2 - 1], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, linopc_ .bez + (iq2 - 1 << 4), 16L);
		e_wsfe();
	    }
	    s_wsfe(&io___3586);
	    do_fio(&c__1, (char *)&sqx, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&sqz, (ftnlen)sizeof(doublereal));
	    e_wsfe();
	    s_wsfe(&io___3587);
	    do_fio(&c__1, (char *)&a11, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&a12, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&a21, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&a22, (ftnlen)sizeof(doublereal));
	    e_wsfe();
	}
	if ((d__1 = ell_ .el[qmodi_ .iq[0] - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    sm0[0] = ell_ .ed[qmodi_ .iq[0] - 1];
	    sm0[1] = ell_ .ed[qmodi_ .iq[1] - 1];
	} else {
	    sm0[0] = ell_ .ek[qmodi_ .iq[0] - 1];
	    sm0[1] = ell_ .ek[qmodi_ .iq[1] - 1];
	}
	dq1 = (d__1 = qwc[0] - qmodi_ .qw0[0], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
	dq2 = (d__1 = qwc[1] - qmodi_ .qw0[1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
	if (nite == 3) {
	    if ((d__1 = ell_ .el[qmodi_ .iq[2] - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
		sm0[2] = ell_ .ed[qmodi_ .iq[2] - 1];
	    } else {
		sm0[2] = ell_ .ek[qmodi_ .iq[2] - 1];
	    }
	    dq3 = (d__1 = qwc[2] - qmodi_ .qw0[2], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
	    if (dq1 < clo_ .dqq && dq2 < clo_ .dqq && dq3 < clo_ .dqq) {
		return 0;
	    }
	} else {
	    if (dq1 < clo_ .dqq && dq2 < clo_ .dqq) {
		return 0;
	    }
	}
 
    }
    s_wsfe(&io___3591);
    do_fio(&c__1, (char *)& clo_ .itqv, (ftnlen)sizeof(integer));
    e_wsfe();
 

    return 0;
}  

 
 
  int ranecu_0_(n__, rvec, len, mcut, is1, is2)
int n__;
doublereal *rvec;
integer *len, *mcut, *is1, *is2;
{
     

    static integer iseed1 = 12345;
    static integer iseed2 = 67890;

     
    doublereal d__1;

     
    double atan(), log(), pow_dd(), cos();

     
    static integer i__, j, k;
    static doublereal r__[2], pi;
    static integer iz;
    static doublereal rvec0;

 

     
    if (rvec) {
	--rvec;
	}

     
    switch(n__) {
	case 1: goto L_recuin;
	case 2: goto L_recuut;
	}

    pi = atan(1.) * 4.;
 
    i__ = 1;
L10:
    for (j = 1; j <= 2; ++j) {
	k = iseed1 / 53668;
	iseed1 = (iseed1 - k * 53668) * 40014 - k * 12211;
	if (iseed1 < 0) {
	    iseed1 += 2147483563;
	}
	k = iseed2 / 52774;
	iseed2 = (iseed2 - k * 52774) * 40692 - k * 3791;
	if (iseed2 < 0) {
	    iseed2 += 2147483399;
	}
	iz = iseed1 - iseed2;
	if (iz < 1) {
	    iz += 2147483562;
	}
	r__[j - 1] = (doublereal) iz;
	r__[j - 1] *= (float)4.656613e-10;
 
    }
    d__1 = log(r__[0]) * -2.;
    rvec0 = pow_dd(&d__1, &c_b461) * cos(pi * 2. * r__[1]);
    if ((( rvec0 ) >= 0 ? ( rvec0 ) : -( rvec0 ))  <= (doublereal) (*mcut) || *mcut == 0) {
	rvec[i__] = rvec0;
	++i__;
    }
    if (i__ <= *len) {
	goto L10;
    }
 
 
    return 0;

L_recuin:
    iseed1 = *is1;
    iseed2 = *is2;
    return 0;

L_recuut:
    *is1 = iseed1;
    *is2 = iseed2;
    return 0;
}  

  int ranecu_(rvec, len, mcut)
doublereal *rvec;
integer *len, *mcut;
{
    return ranecu_0_(0, rvec, len, mcut, (integer *)0, (integer *)0);
    }

  int recuin_(is1, is2)
integer *is1, *is2;
{
    return ranecu_0_(1, (doublereal *)0, (integer *)0, (integer *)0, is1, is2)
	    ;
    }

  int recuut_(is1, is2)
integer *is1, *is2;
{
    return ranecu_0_(2, (doublereal *)0, (integer *)0, (integer *)0, is1, is2)
	    ;
    }

 
  int resb6_(h__, ft, cjg)
integer *h__, *ft, *cjg;
{
     

    static integer b1 = 0;
    static integer b2 = 0;
    static integer b3 = 0;

    extern doublereal gbm6_(), gam6_();
    extern   int trx6_(), daadd_();
    extern   doublereal tuer6_();
    extern   int dadal_(), daall_(), dacfu_(), dacop_();

 
 
 
 
 


     
    --cjg;

     

    daall_(h__, &c__1, "H         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(ft, &c__1, "FT        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&cjg[1], &c__12, "CJG       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&b1, &c__1, "B1        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&b2, &c__1, "B2        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&b3, &c__1, "B3        ", & ii_ .no, & ii_ .nv, 10L);
 
 
    trx6_(h__, &b1, &cjg[1]);
 
    dacfu_(h__, gam6_, &b2);
 
    dacfu_(h__, tuer6_, &b3);
    dacop_(&b3, h__);
    dacfu_(&b1, gbm6_, &b3);
    daadd_(&b2, &b3, ft);
    dadal_(&b3, &c__1);
    dadal_(&b2, &c__1);
    dadal_(&b1, &c__1);
    return 0;
}  

 
 
  int resex_(dpp)
doublereal *dpp;
{
     
    integer i__1, i__2, i__3, i__4, i__5;
    doublereal d__1;

     
    double atan(), sqrt(), cos(), sin(), d_int();

     
    static doublereal tiltckuk, b[100]	 , e[100]	 
;
    static integer i__, j, k, l, n;
    static doublereal t[20]	 , b1, b2;
    static integer i1, i2, k1, l1, l2, m2, n2, m4;
    static doublereal r0;
    static integer m6;
    static doublereal aa[11], bb[11], ea, eb;
    static integer dj;
    static doublereal ep[2], re[180]	 ;
    static integer ip[180]	 ;
    static doublereal cr[11], qw[2], ci[11];
    static integer ii;
    static doublereal dt;
    static integer ns, ik, ll, ix, jj, jm, jk;
    static doublereal qu, ab1[10], ab2[10], qv, xs, zs, xl, zl;
    static integer mx, im;
    static doublereal r0a;
    static integer np;
    static doublereal sb1, sb2;
    static integer n2e, nv;
    static doublereal re1;
    static integer mm, nn1, nn2, nf1, np2, nf3;
    static doublereal rn2;
    static integer nf4, jl, nv1, nv2;
    static doublereal qu1;
    static integer nz2[9];
    static doublereal alfa[2], phi[2], dpr[5], beta[2];
    static integer nnf[10];
    static doublereal chy[162]	 , shy[162]	 
;
    static integer min__[5], ium;
    static doublereal btc, bts, phy, del, phibf[2], pie, etl, radi;
    extern   int clorb_();
    static integer izu;
    extern   int envar_(), error_();
    static doublereal dphi, puf;
    static integer kpz, kzz;
    static doublereal dyy1, dyy2, ekk, crkve, cikve;
    static integer mpe;
    static doublereal cxzr, cxzi, cxzyr, cxzyi, dppi;
    static integer nmz;
    static doublereal benkr;
    static integer lmin;
    static doublereal dyy11, res;
    static integer nkk;
    static doublereal gerad, sea, seb, vdt1;
    static integer nv11, nv21;
    static doublereal vdt2, vdt3;
    extern   int betalf_();
    static doublereal tiltck, tiltsk, cxzyrr, tiltck1, tiltck2, tiltck3, 
	    tiltck4, tiltck5, tiltsk1, tiltsk2, tiltsk3, tiltsk4, tiltsk5;

 

 
 
 

 

    ium = 5;
    i__1 = ium;
    for (i__ = 1; i__ <= i__1; ++i__) {
	dpr[i__ - 1] = 0.;
 
    }
    i__1 = ium;
    for (i__ = 1; i__ <= i__1; ++i__) {
	for (j = 1; j <= 4; ++j) {
	    t[i__ + j * 5 - 6] = 0.;
 
	}
    }
    for (i__ = 1; i__ <= 2; ++i__) {
	beta[i__ - 1] = 0.;
	alfa[i__ - 1] = 0.;
	phi[i__ - 1] = 0.;
	phibf[i__ - 1] = 0.;
	qw[i__ - 1] = 0.;
	ep[i__ - 1] = 0.;
 
    }
    for (i__ = 1; i__ <= 10; ++i__) {
	nnf[i__ - 1] = 0;
	for (j = 1; j <= 18; ++j) {
	    ip[i__ + j * 10 - 11] = 0;
	    re[i__ + j * 10 - 11] = 0.;
 
	}
    }
    for (i__ = 1; i__ <= 11; ++i__) {
	aa[i__ - 1] = 0.;
	bb[i__ - 1] = 0.;
	cr[i__ - 1] = 0.;
	ci[i__ - 1] = 0.;
 
    }
    for (i__ = 1; i__ <= 9; ++i__) {
	nz2[i__ - 1] = 0;
	for (j = 1; j <= 18; ++j) {
	    chy[i__ + j * 9 - 10] = 0.;
	    shy[i__ + j * 9 - 10] = 0.;
	    for (k = 1; k <= 10; ++k) {
		for (ii = 1; ii <= 10; ++ii) {
		    e[k + ii * 10 - 11] = 0.;
		    b[k + ii * 10 - 11] = 0.;
 
		}
		for (l = 1; l <= 5; ++l) {
		    secom_ .rtc[i__ + (j + (k + l * 10) * 18) * 9 - 1792] = 
			    0.;
		    secom_ .rts[i__ + (j + (k + l * 10) * 18) * 9 - 1792] = 
			    0.;
		    min__[l - 1] = 0;
 
		}
 
	    }
 
	}
 
    }
    btc = 0.;
    bts = 0.;
    phy = 0.;
    dt = 0.;
    del = 0.;
    ns = 0;
    ik = 0;
    pie = kons_ .pi * 2.;
    etl = 0.;
    radi = subres_ .totl / pie;
    dpr[0] = *dpp * 1e3;
    clorb_(dpp);
    betalf_(dpp, qw);
    if (erro_ .ierro != 0) {
	i__1 = erro_ .ierro + 22;
	error_(&i__1);
    }
    envar_(dpp);
 
    for (l = 1; l <= 2; ++l) {
	ll = l << 1;
	alfa[l - 1] = (tra_._1) .alf0[l - 1];
	beta[l - 1] = (tra_._1) .bet0[l - 1];
	t[(ll - 1) * 5 - 5] = (tra_._1) .clo[l - 1];
 
	t[ll * 5 - 5] = (tra_._1) .clop[l - 1];
    }
    for (i__ = 1; i__ <= 4; ++i__) {
	for (j = 1; j <= 4; ++j) {
	    t[i__ + 1 + j * 5 - 6] = beo_ .ta[j + i__ * 6 - 7];
 
	    t[i__ + 1 + j * 5 - 6] = beo_ .ta[j + i__ * 6 - 7];
	}
    }
 
    ep[0] = subres_ .tam1 * subres_ .tam1 / beta[0];
    ep[1] = subres_ .tam2 * subres_ .tam2 / beta[1];
 
    izu = 0;
    i__1 = str_ .iu;
    for (k = 1; k <= i__1; ++k) {
	for (k1 = 1; k1 <= 10; ++k1) {
	    ab1[k1 - 1] = 0.;
 
	    ab2[k1 - 1] = 0.;
	}
	ix = str_ .ic[k - 1];
	if (ix > 300) {
	    goto L210;
	}
	jj = 0;
	dj = 1;
	if (ix > 0) {
	    goto L140;
	}
	ix = -ix;
	jj = str2_ .mel[ix - 1] + 1;
	dj = -1;
L140:
	jm = str2_ .mel[ix - 1];
 
	i__2 = jm;
	for (j = 1; j <= i__2; ++j) {
	    jj += dj;
	    jk = str2_ .mtyp[ix + jj * 300 - 301];
	    if (tit_ .ithick == 1 && ell_ .kz[jk - 1] != 0) {
		goto L170;
	    }
	    if (tit_ .ithick == 0 && ell_ .kz[jk - 1] != 0) {
		goto L770;
	    }
 
	    etl += ell_ .el[jk - 1];
	    for (l = 1; l <= 2; ++l) {
		ll = l << 1;
		if ((d__1 = t[ll + (ll - 1) * 5 - 6], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		    phibf[l - 1] = atan(t[ll + 1 + (ll - 1) * 5 - 6] / t[ll + 
			    (ll - 1) * 5 - 6]);
		} else {
		    phibf[l - 1] = kons_ .pi2;
		}
		i__3 = ium;
		for (i__ = 1; i__ <= i__3; ++i__) {
 
		    t[i__ + (ll - 1) * 5 - 6] += t[i__ + ll * 5 - 6] * 
			    ell_ .el[jk - 1];
		}
	    }
	    for (l = 1; l <= 2; ++l) {
		ll = l << 1;
		beta[l - 1] = t[ll + (ll - 1) * 5 - 6] * t[ll + (ll - 1) * 5 
			- 6] + t[ll + 1 + (ll - 1) * 5 - 6] * t[ll + 1 + (ll 
			- 1) * 5 - 6];
		alfa[l - 1] = -(t[ll + (ll - 1) * 5 - 6] * t[ll + ll * 5 - 6] 
			+ t[ll + 1 + (ll - 1) * 5 - 6] * t[ll + 1 + ll * 5 - 
			6]);
		if ((d__1 = t[ll + (ll - 1) * 5 - 6], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		    dphi = atan(t[ll + 1 + (ll - 1) * 5 - 6] / t[ll + (ll - 1)
			     * 5 - 6]) - phibf[l - 1];
		} else {
		    dphi = kons_ .pi2 - phibf[l - 1];
		}
		if (-dphi > 1e-17) {
		    dphi += kons_ .pi;
		}
 
		phi[l - 1] += dphi;
	    }
	    goto L200;
 
L170:
	    if (ell_ .kz[jk - 1] != 8) {
		etl += ell_ .el[jk - 1];
	    }
	    for (l = 1; l <= 2; ++l) {
		ll = l << 1;
		if ((d__1 = t[ll + (ll - 1) * 5 - 6], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		    phibf[l - 1] = atan(t[ll + 1 + (ll - 1) * 5 - 6] / t[ll + 
			    (ll - 1) * 5 - 6]);
		} else {
		    phibf[l - 1] = 0.;
		}
		i__3 = ium;
		for (i__ = 1; i__ <= i__3; ++i__) {
		    puf = t[i__ + (ll - 1) * 5 - 6];
		    t[i__ + (ll - 1) * 5 - 6] = puf * mat_ .a[jk + (l + 2) * 
			    700 - 2101] + t[i__ + ll * 5 - 6] * mat_ .a[jk + (
			    l + 4) * 700 - 2101] + dpr[i__ - 1] * mat_ .a[jk 
			    + (l + 10) * 700 - 2101];
 
		    t[i__ + ll * 5 - 6] = puf * mat_ .a[jk + (l + 6) * 700 - 
			    2101] + t[i__ + ll * 5 - 6] * mat_ .a[jk + (l + 8)
			     * 700 - 2101] + dpr[i__ - 1] * mat_ .a[jk + (l + 
			    12) * 700 - 2101];
		}
	    }
	    for (l = 1; l <= 2; ++l) {
		ll = l << 1;
		beta[l - 1] = t[ll + (ll - 1) * 5 - 6] * t[ll + (ll - 1) * 5 
			- 6] + t[ll + 1 + (ll - 1) * 5 - 6] * t[ll + 1 + (ll 
			- 1) * 5 - 6];
		alfa[l - 1] = -(t[ll + (ll - 1) * 5 - 6] * t[ll + ll * 5 - 6] 
			+ t[ll + 1 + (ll - 1) * 5 - 6] * t[ll + 1 + ll * 5 - 
			6]);
		if ((d__1 = t[ll + (ll - 1) * 5 - 6], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		    dphi = atan(t[ll + 1 + (ll - 1) * 5 - 6] / t[ll + (ll - 1)
			     * 5 - 6]) - phibf[l - 1];
		} else {
		    dphi = -phibf[l - 1];
		}
		if (-dphi > 1e-17) {
		    dphi += kons_ .pi;
		}
 
		phi[l - 1] += dphi;
	    }
L200:
	    ;
	}
	goto L770;
 
L210:
	ix += -300;
	qu = 0.;
	qv = 0.;
	kpz = ell_ .kp[ix - 1];
	if (kpz == 6) {
	    goto L770;
	}
	kzz = ell_ .kz[ix - 1];
	if (kzz == 0) {
	    goto L770;
	}
	dyy1 = 0.;
	dyy2 = 0.;
	if (rand0_ .iorg < 0) {
	    rand0_ .mzu[k - 1] = izu;
	}
	izu = rand0_ .mzu[k - 1] + 1;
	ekk = (ell_ .sm[ix - 1] + rand0_ .zfz[izu - 1] * ell_ .ek[ix - 1]) / (
		*dpp + 1.);
	++izu;
	xs = pla_ .xpl[ix - 1] + rand0_ .zfz[izu - 1] * pla_ .xrms[ix - 1];
	++izu;
	zs = pla_ .zpl[ix - 1] + rand0_ .zfz[izu - 1] * pla_ .zrms[ix - 1];
	xl = (t[0] - xs) * rand1_ .tiltc[k - 1] + (t[10] - zs) * 
		rand1_ .tilts[k - 1];
	zl = -(t[0] - xs) * rand1_ .tilts[k - 1] + (t[10] - zs) * 
		rand1_ .tiltc[k - 1];
	crkve = xl;
	cikve = zl;
	if (kzz < 0) {
	    goto L370;
	}
	switch ((int)kzz) {
	    case 1:  goto L220;
	    case 2:  goto L230;
	    case 3:  goto L240;
	    case 4:  goto L250;
	    case 5:  goto L260;
	    case 6:  goto L270;
	    case 7:  goto L280;
	    case 8:  goto L290;
	    case 9:  goto L300;
	    case 10:  goto L310;
	    case 11:  goto L320;
	}
	goto L770;
 
L220:
	ekk *= 1e3;
	mpe = 20;
	dyy1 = ekk * rand1_ .tiltc[k - 1];
	dyy2 = ekk * rand1_ .tilts[k - 1];
	qu = 0.;
	qv = 0.;
	goto L480;
 
L230:
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * xl + rand1_ .tilts[k - 1] * zl);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * zl + rand1_ .tilts[k - 1] * xl);
	mpe = 20;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * tiltck;
	qv = -ekk * tiltsk;
	ab1[1] = qu;
	ab2[1] = -qv;
	goto L480;
 
L240:
	ekk *= .001;
	mpe = 3;
	mx = 1;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cxzyi + rand1_ .tilts[k - 1] * 
		cxzyr);
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 2. * (tiltck * xl + tiltsk * zl);
	qv = ekk * 2. * (tiltck * zl - tiltsk * xl);
	ab1[1] = qu;
	ab2[1] = -qv;
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[2] = ekk * tiltck;
	ab2[2] = ekk * tiltsk;
	goto L480;
 
L250:
	ekk *= 1e-6;
	mpe = 4;
	mx = 2;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 3. * (tiltck * cxzyr + tiltsk * cxzyi);
	qv = ekk * 3. * (tiltck * cxzyi - tiltsk * cxzyr);
	ab1[1] = qu;
	ab2[1] = -qv;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cxzyi + rand1_ .tilts[k - 1] * 
		cxzyr);
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[2] = ekk * 3. * (tiltck * xl + tiltsk * zl);
	ab2[2] = ekk * 3. * (-tiltck * zl + tiltsk * xl);
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[3] = ekk * tiltck;
	ab2[3] = ekk * tiltsk;
	goto L480;
 
L260:
	ekk *= 1e-9;
	mpe = 5;
	mx = 3;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk1 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 
		1];
	tiltck1 = tiltckuk;
	ab1[2] = ekk * 6 * (tiltck1 * cxzyr + tiltsk1 * cxzyi);
	ab2[2] = ekk * 6 * (-tiltck1 * cxzyi + tiltsk1 * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	qu = ekk * 4. * (tiltck * cxzyr + tiltsk * cxzyi);
	qv = ekk * 4. * (tiltck * cxzyi - tiltsk * cxzyr);
	ab1[1] = qu;
	ab2[1] = -qv;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cxzyi + rand1_ .tilts[k - 1] * 
		cxzyr);
	tiltckuk = tiltck1 * rand1_ .tiltc[k - 1] - tiltsk1 * rand1_ .tilts[k 
		- 1];
	tiltsk = tiltck1 * rand1_ .tilts[k - 1] + tiltsk1 * rand1_ .tiltc[k - 
		1];
	tiltck = tiltckuk;
	ab1[3] = ekk * 4. * (tiltck * xl + tiltsk * zl);
	ab2[3] = ekk * 4. * (-tiltck * zl + tiltsk * xl);
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[4] = ekk * tiltck;
	ab2[4] = ekk * tiltsk;
	goto L480;
 
L270:
	ekk *= 1e-12;
	mpe = 6;
	mx = 4;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk1 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 
		1];
	tiltck1 = tiltckuk;
	tiltckuk = tiltck1 * rand1_ .tiltc[k - 1] - tiltsk1 * rand1_ .tilts[k 
		- 1];
	tiltsk2 = tiltck1 * rand1_ .tilts[k - 1] + tiltsk1 * rand1_ .tiltc[k 
		- 1];
	tiltck2 = tiltckuk;
	ab1[3] = ekk * 10 * (tiltck2 * cxzyr + tiltsk2 * cxzyi);
	ab2[3] = ekk * 10 * (-tiltck2 * cxzyi + tiltsk2 * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[2] = ekk * 10 * (tiltck1 * cxzyr + tiltsk1 * cxzyi);
	ab2[2] = ekk * 10 * (-tiltck1 * cxzyi + tiltsk1 * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	qu = ekk * 5 * (tiltck * cxzyr + tiltsk * cxzyi);
	qv = ekk * 5 * (tiltck * cxzyi - tiltsk * cxzyr);
	ab1[1] = qu;
	ab2[1] = -qv;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cxzyi + rand1_ .tilts[k - 1] * 
		cxzyr);
	tiltckuk = tiltck2 * rand1_ .tiltc[k - 1] - tiltsk2 * rand1_ .tilts[k 
		- 1];
	tiltsk = tiltck2 * rand1_ .tilts[k - 1] + tiltsk2 * rand1_ .tiltc[k - 
		1];
	tiltck = tiltckuk;
	ab1[4] = ekk * 5 * (tiltck * xl + tiltsk * zl);
	ab2[4] = ekk * 5 * (-tiltck * zl + tiltsk * xl);
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[5] = ekk * tiltck;
	ab2[5] = ekk * tiltsk;
	goto L480;
 
L280:
	ekk *= 1e-15;
	mpe = 7;
	mx = 5;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk1 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 
		1];
	tiltck1 = tiltckuk;
	tiltckuk = tiltck1 * rand1_ .tiltc[k - 1] - tiltsk1 * rand1_ .tilts[k 
		- 1];
	tiltsk2 = tiltck1 * rand1_ .tilts[k - 1] + tiltsk1 * rand1_ .tiltc[k 
		- 1];
	tiltck2 = tiltckuk;
	tiltckuk = tiltck2 * rand1_ .tiltc[k - 1] - tiltsk2 * rand1_ .tilts[k 
		- 1];
	tiltsk3 = tiltck2 * rand1_ .tilts[k - 1] + tiltsk2 * rand1_ .tiltc[k 
		- 1];
	tiltck3 = tiltckuk;
	ab1[4] = ekk * 15 * (tiltck3 * cxzyr + tiltsk3 * cxzyi);
	ab2[4] = ekk * 15 * (-tiltck3 * cxzyi + tiltsk3 * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[3] = ekk * 20 * (tiltck2 * cxzyr + tiltsk2 * cxzyi);
	ab2[3] = ekk * 20 * (-tiltck2 * cxzyi + tiltsk2 * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[4] = ekk * 15 * (tiltck1 * cxzyr + tiltsk1 * cxzyi);
	ab2[4] = ekk * 15 * (-tiltck1 * cxzyi + tiltsk1 * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	qu = ekk * 6 * (tiltck * cxzyr + tiltsk * cxzyi);
	qv = ekk * 6 * (tiltck * cxzyi - tiltsk * cxzyr);
	ab1[1] = qu;
	ab2[1] = -qv;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cxzyi + rand1_ .tilts[k - 1] * 
		cxzyr);
	tiltckuk = tiltck3 * rand1_ .tiltc[k - 1] - tiltsk3 * rand1_ .tilts[k 
		- 1];
	tiltsk = tiltck3 * rand1_ .tilts[k - 1] + tiltsk3 * rand1_ .tiltc[k - 
		1];
	tiltck = tiltckuk;
	ab1[5] = ekk * 6 * (tiltck * xl + tiltsk * zl);
	ab2[5] = ekk * 6 * (-tiltck * zl + tiltsk * xl);
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[6] = ekk * tiltck;
	ab2[6] = ekk * tiltsk;
	goto L480;
 
L290:
	ekk *= 1e-18;
	mpe = 8;
	mx = 6;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk1 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 
		1];
	tiltck1 = tiltckuk;
	tiltckuk = tiltck1 * rand1_ .tiltc[k - 1] - tiltsk1 * rand1_ .tilts[k 
		- 1];
	tiltsk2 = tiltck1 * rand1_ .tilts[k - 1] + tiltsk1 * rand1_ .tiltc[k 
		- 1];
	tiltck2 = tiltckuk;
	tiltckuk = tiltck2 * rand1_ .tiltc[k - 1] - tiltsk2 * rand1_ .tilts[k 
		- 1];
	tiltsk3 = tiltck2 * rand1_ .tilts[k - 1] + tiltsk2 * rand1_ .tiltc[k 
		- 1];
	tiltck3 = tiltckuk;
	tiltckuk = tiltck3 * rand1_ .tiltc[k - 1] - tiltsk3 * rand1_ .tilts[k 
		- 1];
	tiltsk4 = tiltck3 * rand1_ .tilts[k - 1] + tiltsk3 * rand1_ .tiltc[k 
		- 1];
	tiltck4 = tiltckuk;
	ab1[5] = ekk * 21 * (tiltck4 * cxzyr + tiltsk4 * cxzyi);
	ab2[5] = ekk * 21 * (-tiltck4 * cxzyi + tiltsk4 * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[4] = ekk * 35 * (tiltck3 * cxzyr + tiltsk3 * cxzyi);
	ab2[4] = ekk * 35 * (-tiltck3 * cxzyi + tiltsk3 * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[3] = ekk * 35 * (tiltck2 * cxzyr + tiltsk2 * cxzyi);
	ab2[3] = ekk * 35 * (-tiltck2 * cxzyi + tiltsk2 * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[2] = ekk * 21 * (tiltck1 * cxzyr + tiltsk1 * cxzyi);
	ab2[2] = ekk * 21 * (-tiltck1 * cxzyi + tiltsk1 * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	qu = ekk * 7 * (tiltck * cxzyr + tiltsk * cxzyi);
	qv = ekk * 7 * (tiltck * cxzyi - tiltsk * cxzyr);
	ab1[1] = qu;
	ab2[1] = -qv;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cxzyi + rand1_ .tilts[k - 1] * 
		cxzyr);
	tiltckuk = tiltck4 * rand1_ .tiltc[k - 1] - tiltsk4 * rand1_ .tilts[k 
		- 1];
	tiltsk = tiltck4 * rand1_ .tilts[k - 1] + tiltsk4 * rand1_ .tiltc[k - 
		1];
	tiltck = tiltckuk;
	ab1[6] = ekk * 7 * (tiltck * xl + tiltsk * zl);
	ab2[6] = ekk * 7 * (-tiltck * zl + tiltsk * xl);
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[7] = ekk * tiltck;
	ab2[7] = ekk * tiltsk;
	goto L480;
 
L300:
	ekk *= 1e-21;
	mpe = 9;
	mx = 7;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk1 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 
		1];
	tiltck1 = tiltckuk;
	tiltckuk = tiltck1 * rand1_ .tiltc[k - 1] - tiltsk1 * rand1_ .tilts[k 
		- 1];
	tiltsk2 = tiltck1 * rand1_ .tilts[k - 1] + tiltsk1 * rand1_ .tiltc[k 
		- 1];
	tiltck2 = tiltckuk;
	tiltckuk = tiltck2 * rand1_ .tiltc[k - 1] - tiltsk2 * rand1_ .tilts[k 
		- 1];
	tiltsk3 = tiltck2 * rand1_ .tilts[k - 1] + tiltsk2 * rand1_ .tiltc[k 
		- 1];
	tiltck3 = tiltckuk;
	tiltckuk = tiltck3 * rand1_ .tiltc[k - 1] - tiltsk3 * rand1_ .tilts[k 
		- 1];
	tiltsk4 = tiltck3 * rand1_ .tilts[k - 1] + tiltsk3 * rand1_ .tiltc[k 
		- 1];
	tiltck4 = tiltckuk;
	tiltckuk = tiltck4 * rand1_ .tiltc[k - 1] - tiltsk4 * rand1_ .tilts[k 
		- 1];
	tiltsk5 = tiltck4 * rand1_ .tilts[k - 1] + tiltsk4 * rand1_ .tiltc[k 
		- 1];
	tiltck5 = tiltckuk;
	ab1[6] = ekk * 28 * (tiltck5 * cxzyr + tiltsk5 * cxzyi);
	ab2[6] = ekk * 28 * (-tiltck5 * cxzyi + tiltsk5 * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[5] = ekk * 56 * (tiltck4 * cxzyr + tiltsk4 * cxzyi);
	ab2[5] = ekk * 56 * (-tiltck4 * cxzyi + tiltsk4 * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[4] = ekk * 70 * (tiltck3 * cxzyr + tiltsk3 * cxzyi);
	ab2[4] = ekk * 70 * (-tiltck3 * cxzyi + tiltsk3 * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[3] = ekk * 56 * (tiltck2 * cxzyr + tiltsk2 * cxzyi);
	ab2[3] = ekk * 56 * (-tiltck2 * cxzyi + tiltsk2 * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[2] = ekk * 28 * (tiltck1 * cxzyr + tiltsk1 * cxzyi);
	ab2[2] = ekk * 28 * (-tiltck1 * cxzyi + tiltsk1 * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	qu = ekk * 8 * (tiltck * cxzyr + tiltsk * cxzyi);
	qv = ekk * 8 * (tiltck * cxzyi - tiltsk * cxzyr);
	ab1[1] = qu;
	ab2[1] = -qv;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cxzyi + rand1_ .tilts[k - 1] * 
		cxzyr);
	tiltckuk = tiltck5 * rand1_ .tiltc[k - 1] - tiltsk5 * rand1_ .tilts[k 
		- 1];
	tiltsk = tiltck5 * rand1_ .tilts[k - 1] + tiltsk5 * rand1_ .tiltc[k - 
		1];
	tiltck = tiltckuk;
	ab1[7] = ekk * 8 * (tiltck * xl + tiltsk * zl);
	ab2[7] = ekk * 8 * (-tiltck * zl + tiltsk * xl);
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[8] = ekk * tiltck;
	ab2[8] = ekk * tiltsk;
	goto L480;
 
L310:
	ekk *= 1e-24;
	mpe = 20;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 9 * (tiltck * cxzyr + tiltsk * cxzyi);
	qv = ekk * 9 * (tiltck * cxzyi - tiltsk * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cxzyi + rand1_ .tilts[k - 1] * 
		cxzyr);
	goto L480;
L320:
	r0 = ell_ .ek[ix - 1];
	if ((d__1 = dkic_ .dki[ix - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
	    if ((d__1 = dkic_ .dki[ix + 1399], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		qu = - dkic_ .dki[ix - 1] / dkic_ .dki[ix + 1399] * dkic_ .dki[
			ix - 1] / (*dpp + 1.);
		dppi = dkic_ .dki[ix - 1] * 1e3 / (*dpp + 1.);
		t[5] = t[5] + (qu * xl - dppi * *dpp) * rand1_ .tiltc[k - 1] 
			+ dppi * (1. - rand1_ .tiltc[k - 1]);
		t[15] = t[15] + (qu * xl - dppi * *dpp) * rand1_ .tilts[k - 1]
			 + dppi * rand1_ .tilts[k - 1];
		i__2 = ium;
		for (i__ = 2; i__ <= i__2; ++i__) {
		    t[i__ + 4] += qu * t[i__ - 1] * rand1_ .tiltc[k - 1];
		    t[i__ + 14] += qu * t[i__ + 9] * rand1_ .tilts[k - 1];
 
		}
	    } else {
		dppi = dkic_ .dki[ix - 1] * 1e3 / (*dpp + 1.);
		t[5] = t[5] - dppi * *dpp * rand1_ .tiltc[k - 1] + dppi * (1. 
			- rand1_ .tiltc[k - 1]);
		t[15] = t[15] - dppi * *dpp * rand1_ .tilts[k - 1] + dppi * 
			rand1_ .tilts[k - 1];
	    }
	}
	if ((d__1 = dkic_ .dki[ix + 699], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
	    if ((d__1 = dkic_ .dki[ix + 1399], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		qu = dkic_ .dki[ix + 699] / dkic_ .dki[ix + 1399] * 
			dkic_ .dki[ix + 699] / (*dpp + 1.);
		dppi = dkic_ .dki[ix + 699] * 1e3 / (*dpp + 1.);
		t[5] = t[5] + (qu * zl - dppi * *dpp) * rand1_ .tilts[k - 1] 
			+ dppi * rand1_ .tilts[k - 1];
		t[15] = t[15] + (-qu * zl + dppi * *dpp) * rand1_ .tiltc[k - 
			1] - dppi * (1. - rand1_ .tiltc[k - 1]);
		i__2 = ium;
		for (i__ = 2; i__ <= i__2; ++i__) {
		    t[i__ + 4] += qu * t[i__ - 1] * rand1_ .tilts[k - 1];
		    t[i__ + 14] -= qu * t[i__ + 9] * rand1_ .tiltc[k - 1];
 
		}
	    } else {
		dppi = dkic_ .dki[ix + 699] * 1e3 / (*dpp + 1.);
		t[5] = t[5] - dppi * *dpp * rand1_ .tilts[k - 1] + dppi * 
			rand1_ .tilts[k - 1];
		t[15] = t[15] + dppi * *dpp * rand1_ .tiltc[k - 1] - dppi * (
			1. - rand1_ .tiltc[k - 1]);
	    }
	}
	mpe = 9;
	mx = 0;
	if ((( r0 ) >= 0 ? ( r0 ) : -( r0 ))  <= 1e-17) {
	    goto L770;
	}
	nmz = mult1_ .nmu[ix - 1];
	if (nmz == 0) {
	    izu += 22;
	    goto L770;
	}
	im = mult1_ .irm[ix - 1];
	r0a = 1.;
	benkr = ell_ .ed[ix - 1] / (*dpp + 1.);
	cr[0] = 1.;
	cr[1] = xl;
	ci[1] = zl;
	cxzyr = xl;
	cxzyi = zl;
	cxzr = cxzyr;
	cxzi = cxzyi;
	dyy1 = 0.;
	dyy2 = 0.;
	qu = 0.;
	qv = 0.;
	lmin = 3;
	if (nmz == 1) {
	    lmin = 2;
	}
	for (l = lmin; l <= 11; ++l) {
	    cr[l - 1] = 0.;
 
	    ci[l - 1] = 0.;
	}
	i__2 = nmz;
	for (l = 1; l <= i__2; ++l) {
	    l1 = l - 1;
	    ++izu;
	    aa[l - 1] = multi_ .ak0[im + l * 700 - 701] + rand0_ .zfz[izu - 1]
		     * multi_ .aka[im + l * 700 - 701];
	    aa[l - 1] = benkr * aa[l - 1] / r0a;
	    ++izu;
	    bb[l - 1] = multi_ .bk0[im + l * 700 - 701] + rand0_ .zfz[izu - 1]
		     * multi_ .bka[im + l * 700 - 701];
	    bb[l - 1] = benkr * bb[l - 1] / r0a;
	    r0a *= r0;
	    if (l > 2) {
		cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
		cxzyi = cxzyr * cxzi + cxzyi * cxzr;
		cxzyr = cxzyrr;
		cr[l - 1] = cxzyr;
		ci[l - 1] = cxzyi;
	    }
	    dyy1 = dyy1 + bb[l - 1] * cr[l - 1] + aa[l - 1] * ci[l - 1];
	    dyy2 = dyy2 - bb[l - 1] * ci[l - 1] + aa[l - 1] * cr[l - 1];
	    if (l > 1 && ium != 1) {
		qu += l1 * (bb[l - 1] * cr[l1 - 1] + aa[l - 1] * ci[l1 - 1]);
		qv += l1 * (bb[l - 1] * ci[l1 - 1] - aa[l - 1] * cr[l1 - 1]);
	    }
 
	}
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu1 = tiltck * qu - tiltsk * qv;
	qv = tiltck * qv + tiltsk * qu;
	qu = qu1;
	dyy11 = rand1_ .tiltc[k - 1] * dyy1 - rand1_ .tilts[k - 1] * dyy2;
	dyy2 = rand1_ .tiltc[k - 1] * dyy2 + rand1_ .tilts[k - 1] * dyy1;
	dyy1 = dyy11;
	izu = izu + 22 - (nmz << 1);
	goto L480;
 
L370:
	kzz = -kzz;
	switch ((int)kzz) {
	    case 1:  goto L380;
	    case 2:  goto L390;
	    case 3:  goto L400;
	    case 4:  goto L410;
	    case 5:  goto L420;
	    case 6:  goto L430;
	    case 7:  goto L440;
	    case 8:  goto L450;
	    case 9:  goto L460;
	    case 10:  goto L470;
	}
	goto L770;
 
L380:
	ekk *= 1e3;
	mpe = 20;
	dyy1 = -ekk * rand1_ .tilts[k - 1];
	dyy2 = ekk * rand1_ .tiltc[k - 1];
	qu = 0.;
	qv = 0.;
	goto L480;
 
L390:
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * zl - rand1_ .tilts[k - 1] * xl);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * xl + rand1_ .tilts[k - 1] * zl);
	mpe = 2;
	mx = -1;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = -ekk * tiltsk;
	qv = -ekk * tiltck;
	ab1[1] = qu;
	ab2[1] = -qv;
	goto L480;
 
L400:
	ekk *= .001;
	mpe = 3;
	mx = 1;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyi - rand1_ .tilts[k - 1] * 
		cxzyr);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 2. * (tiltck * zl - tiltsk * xl);
	qv = -ekk * 2. * (tiltck * xl + tiltsk * zl);
	ab1[1] = qu;
	ab2[1] = -qv;
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[2] = ekk * tiltsk;
	ab2[2] = ekk * tiltck;
	goto L480;
 
L410:
	ekk *= 1e-6;
	mpe = 4;
	mx = 2;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 3. * (tiltck * cxzyi - tiltsk * cxzyr);
	qv = ekk * -3. * (tiltck * cxzyr + tiltsk * cxzyi);
	ab1[1] = qu;
	ab2[1] = -qv;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyi - rand1_ .tilts[k - 1] * 
		cxzyr);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[2] = ekk * 3. * (tiltck * zl - tiltsk * xl);
	ab2[2] = ekk * 3. * (tiltck * xl + tiltsk * zl);
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[3] = ekk * tiltsk;
	ab2[3] = ekk * tiltck;
	goto L480;
 
L420:
	ekk *= 1e-9;
	mpe = 5;
	mx = 3;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk1 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 
		1];
	tiltck1 = tiltckuk;
	ab1[2] = ekk * 6 * (tiltck1 * cxzyi - tiltsk1 * cxzyr);
	ab2[2] = ekk * 6 * (tiltck1 * cxzyr + tiltsk1 * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	qu = ekk * 4. * (tiltck * cxzyi - tiltsk * cxzyr);
	qv = ekk * -4. * (tiltck * cxzyr + tiltsk * cxzyi);
	ab1[1] = qu;
	ab2[1] = -qv;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyi - rand1_ .tilts[k - 1] * 
		cxzyr);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
	tiltckuk = tiltck1 * rand1_ .tiltc[k - 1] - tiltsk1 * rand1_ .tilts[k 
		- 1];
	tiltsk = tiltck1 * rand1_ .tilts[k - 1] + tiltsk1 * rand1_ .tiltc[k - 
		1];
	tiltck = tiltckuk;
	ab1[3] = ekk * 4. * (tiltck * zl - tiltsk * xl);
	ab2[3] = ekk * 4. * (tiltck * xl + tiltsk * zl);
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[4] = ekk * tiltsk;
	ab2[4] = ekk * tiltck;
	goto L480;
 
L430:
	ekk *= 1e-12;
	mpe = 6;
	mx = 4;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk1 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 
		1];
	tiltck1 = tiltckuk;
	tiltckuk = tiltck1 * rand1_ .tiltc[k - 1] - tiltsk1 * rand1_ .tilts[k 
		- 1];
	tiltsk2 = tiltck1 * rand1_ .tilts[k - 1] + tiltsk1 * rand1_ .tiltc[k 
		- 1];
	tiltck2 = tiltckuk;
	ab1[3] = ekk * 10 * (tiltck2 * cxzyi - tiltsk2 * cxzyr);
	ab2[3] = ekk * 10 * (tiltck2 * cxzyr + tiltsk2 * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[2] = ekk * 10 * (tiltck1 * cxzyi - tiltsk1 * cxzyr);
	ab2[2] = ekk * 10 * (tiltck1 * cxzyr + tiltsk1 * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	qu = ekk * 5 * (tiltck * cxzyi - tiltsk * cxzyr);
	qv = ekk * -5 * (tiltck * cxzyr + tiltsk * cxzyi);
	ab1[1] = qu;
	ab2[1] = -qv;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyi - rand1_ .tilts[k - 1] * 
		cxzyr);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
	tiltckuk = tiltck2 * rand1_ .tiltc[k - 1] - tiltsk2 * rand1_ .tilts[k 
		- 1];
	tiltsk = tiltck2 * rand1_ .tilts[k - 1] + tiltsk2 * rand1_ .tiltc[k - 
		1];
	tiltck = tiltckuk;
	ab1[4] = ekk * 5 * (tiltck * zl - tiltsk * xl);
	ab2[4] = ekk * 5 * (tiltck * xl + tiltsk * zl);
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[5] = ekk * tiltsk;
	ab2[5] = ekk * tiltck;
	goto L480;
 
L440:
	ekk *= 1e-15;
	mpe = 7;
	mx = 5;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk1 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 
		1];
	tiltck1 = tiltckuk;
	tiltckuk = tiltck1 * rand1_ .tiltc[k - 1] - tiltsk1 * rand1_ .tilts[k 
		- 1];
	tiltsk2 = tiltck1 * rand1_ .tilts[k - 1] + tiltsk1 * rand1_ .tiltc[k 
		- 1];
	tiltck2 = tiltckuk;
	tiltckuk = tiltck2 * rand1_ .tiltc[k - 1] - tiltsk2 * rand1_ .tilts[k 
		- 1];
	tiltsk3 = tiltck2 * rand1_ .tilts[k - 1] + tiltsk2 * rand1_ .tiltc[k 
		- 1];
	tiltck3 = tiltckuk;
	ab1[4] = ekk * 15 * (tiltck3 * cxzyi - tiltsk3 * cxzyr);
	ab2[4] = ekk * 15 * (tiltck3 * cxzyr + tiltsk3 * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[3] = ekk * 20 * (tiltck2 * cxzyi - tiltsk2 * cxzyr);
	ab2[3] = ekk * 20 * (tiltck2 * cxzyr + tiltsk2 * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[2] = ekk * 15 * (tiltck1 * cxzyi - tiltsk1 * cxzyr);
	ab2[2] = ekk * 15 * (tiltck1 * cxzyr + tiltsk1 * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	qu = ekk * 6 * (tiltck * cxzyi - tiltsk * cxzyr);
	qv = ekk * -6 * (tiltck * cxzyr + tiltsk * cxzyi);
	ab1[1] = qu;
	ab2[1] = -qv;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyi - rand1_ .tilts[k - 1] * 
		cxzyr);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
	tiltckuk = tiltck3 * rand1_ .tiltc[k - 1] - tiltsk3 * rand1_ .tilts[k 
		- 1];
	tiltsk = tiltck3 * rand1_ .tilts[k - 1] + tiltsk3 * rand1_ .tiltc[k - 
		1];
	tiltck = tiltckuk;
	ab1[5] = ekk * 6 * (tiltck * zl - tiltsk * xl);
	ab2[5] = ekk * 6 * (tiltck * xl + tiltsk * zl);
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[6] = ekk * tiltsk;
	ab2[6] = ekk * tiltck;
	goto L480;
 
L450:
	ekk *= 1e-18;
	mpe = 8;
	mx = 6;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk1 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 
		1];
	tiltck1 = tiltckuk;
	tiltckuk = tiltck1 * rand1_ .tiltc[k - 1] - tiltsk1 * rand1_ .tilts[k 
		- 1];
	tiltsk2 = tiltck1 * rand1_ .tilts[k - 1] + tiltsk1 * rand1_ .tiltc[k 
		- 1];
	tiltck2 = tiltckuk;
	tiltckuk = tiltck2 * rand1_ .tiltc[k - 1] - tiltsk2 * rand1_ .tilts[k 
		- 1];
	tiltsk3 = tiltck2 * rand1_ .tilts[k - 1] + tiltsk2 * rand1_ .tiltc[k 
		- 1];
	tiltck3 = tiltckuk;
	tiltckuk = tiltck3 * rand1_ .tiltc[k - 1] - tiltsk3 * rand1_ .tilts[k 
		- 1];
	tiltsk4 = tiltck3 * rand1_ .tilts[k - 1] + tiltsk3 * rand1_ .tiltc[k 
		- 1];
	tiltck4 = tiltckuk;
	ab1[5] = ekk * 21 * (tiltck4 * cxzyi - tiltsk4 * cxzyr);
	ab2[5] = ekk * 21 * (tiltck4 * cxzyr + tiltsk4 * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[4] = ekk * 35 * (tiltck3 * cxzyi - tiltsk3 * cxzyr);
	ab2[4] = ekk * 35 * (tiltck3 * cxzyr + tiltsk3 * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[3] = ekk * 35 * (tiltck2 * cxzyi - tiltsk2 * cxzyr);
	ab2[3] = ekk * 35 * (tiltck2 * cxzyr + tiltsk2 * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[2] = ekk * 21 * (tiltck1 * cxzyi - tiltsk1 * cxzyr);
	ab2[2] = ekk * 21 * (tiltck1 * cxzyr + tiltsk1 * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	qu = ekk * 7 * (tiltck * cxzyi - tiltsk * cxzyr);
	qv = ekk * -7 * (tiltck * cxzyr + tiltsk * cxzyi);
	ab1[1] = qu;
	ab2[1] = -qv;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyi - rand1_ .tilts[k - 1] * 
		cxzyr);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
	tiltckuk = tiltck4 * rand1_ .tiltc[k - 1] - tiltsk4 * rand1_ .tilts[k 
		- 1];
	tiltsk = tiltck4 * rand1_ .tilts[k - 1] + tiltsk4 * rand1_ .tiltc[k - 
		1];
	tiltck = tiltckuk;
	ab1[6] = ekk * 7 * (tiltck * zl - tiltsk * xl);
	ab2[6] = ekk * 7 * (tiltck * xl + tiltsk * zl);
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[7] = ekk * tiltsk;
	ab2[7] = ekk * tiltck;
	goto L480;
 
L460:
	ekk *= 1e-21;
	mpe = 9;
	mx = 7;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk1 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 
		1];
	tiltck1 = tiltckuk;
	tiltckuk = tiltck1 * rand1_ .tiltc[k - 1] - tiltsk1 * rand1_ .tilts[k 
		- 1];
	tiltsk2 = tiltck1 * rand1_ .tilts[k - 1] + tiltsk1 * rand1_ .tiltc[k 
		- 1];
	tiltck2 = tiltckuk;
	tiltckuk = tiltck2 * rand1_ .tiltc[k - 1] - tiltsk2 * rand1_ .tilts[k 
		- 1];
	tiltsk3 = tiltck2 * rand1_ .tilts[k - 1] + tiltsk2 * rand1_ .tiltc[k 
		- 1];
	tiltck3 = tiltckuk;
	tiltckuk = tiltck3 * rand1_ .tiltc[k - 1] - tiltsk3 * rand1_ .tilts[k 
		- 1];
	tiltsk4 = tiltck3 * rand1_ .tilts[k - 1] + tiltsk3 * rand1_ .tiltc[k 
		- 1];
	tiltck4 = tiltckuk;
	tiltckuk = tiltck4 * rand1_ .tiltc[k - 1] - tiltsk4 * rand1_ .tilts[k 
		- 1];
	tiltsk5 = tiltck4 * rand1_ .tilts[k - 1] + tiltsk4 * rand1_ .tiltc[k 
		- 1];
	tiltck5 = tiltckuk;
	ab1[6] = ekk * 28 * (tiltck5 * cxzyi - tiltsk5 * cxzyr);
	ab2[6] = ekk * 28 * (tiltck5 * cxzyr + tiltsk5 * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[5] = ekk * 56 * (tiltck4 * cxzyi - tiltsk4 * cxzyr);
	ab2[5] = ekk * 56 * (tiltck4 * cxzyr + tiltsk4 * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[4] = ekk * 70 * (tiltck3 * cxzyi - tiltsk3 * cxzyr);
	ab2[4] = ekk * 70 * (tiltck3 * cxzyr + tiltsk3 * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[3] = ekk * 56 * (tiltck2 * cxzyi - tiltsk2 * cxzyr);
	ab2[3] = ekk * 56 * (tiltck2 * cxzyr + tiltsk2 * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[2] = ekk * 28 * (tiltck1 * cxzyi - tiltsk1 * cxzyr);
	ab2[2] = ekk * 28 * (tiltck1 * cxzyr + tiltsk1 * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	qu = ekk * 8 * (tiltck * cxzyi - tiltsk * cxzyr);
	qv = ekk * -8 * (tiltck * cxzyr + tiltsk * cxzyi);
	ab1[1] = qu;
	ab2[1] = -qv;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyi - rand1_ .tilts[k - 1] * 
		cxzyr);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
	tiltckuk = tiltck5 * rand1_ .tiltc[k - 1] - tiltsk5 * rand1_ .tilts[k 
		- 1];
	tiltsk = tiltck5 * rand1_ .tilts[k - 1] + tiltsk5 * rand1_ .tiltc[k - 
		1];
	tiltck = tiltckuk;
	ab1[7] = ekk * 8 * (tiltck * zl - tiltsk * xl);
	ab2[7] = ekk * 8 * (tiltck * xl + tiltsk * zl);
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[8] = ekk * tiltsk;
	ab2[8] = ekk * tiltck;
	goto L480;
 
L470:
	ekk *= 1e-24;
	mpe = 20;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 9 * (tiltck * cxzyi - tiltsk * cxzyr);
	qv = ekk * -9 * (tiltck * cxzyr + tiltsk * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyi - rand1_ .tilts[k - 1] * 
		cxzyr);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
L480:
	t[5] += dyy1;
	t[15] += dyy2;
	i__2 = ium;
	for (i__ = 2; i__ <= i__2; ++i__) {
	    t[i__ + 4] = t[i__ + 4] + qu * t[i__ - 1] - qv * t[i__ + 9];
	    t[i__ + 14] = t[i__ + 14] - qu * t[i__ + 9] - qv * t[i__ - 1];
 
	}
	for (l = 1; l <= 2; ++l) {
	    ll = l << 1;
	    alfa[l - 1] = -(t[ll + (ll - 1) * 5 - 6] * t[ll + ll * 5 - 6] + t[
		    ll + 1 + (ll - 1) * 5 - 6] * t[ll + 1 + ll * 5 - 6]);
 
	}
	if (mpe > 9 || mpe == 9 && nmz <= 1) {
	    goto L770;
	}
	if (mpe < subres_ .nta) {
	    goto L770;
	}
	if (mpe > subres_ .nte) {
	    mpe = subres_ .nte;
	}
	if (subres_ .nta > 2) {
	    goto L520;
	}
	if (mx == -1 || mx == 1 || mx == 2 || mx == 3 || mx == 4 || mx == 5 ||
		 mx == 6 || mx == 7) {
	    goto L520;
	}
 

 
 

	i__2 = nmz;
	for (l = 2; l <= i__2; ++l) {
	    l1 = l - 1;
 
	    ab2[1] += l1 * (aa[l - 1] * cr[l1 - 1] - bb[l - 1] * ci[l1 - 1]);
	}
L520:
	b1 = beta[0];
	b2 = beta[1];
	sb1 = sqrt(b1);
	sb2 = sqrt(b2);
	b[2] = b1;
	b[20] = b2;
	b[11] = sb1 * sb2;
	if (subres_ .nta > 3) {
	    goto L540;
	}
	if (mpe == 2 || mpe == 9 && nmz <= 2) {
	    goto L670;
	}
	if (mx == 1 || mx == 2 || mx == 3 || mx == 4 || mx == 5 || mx == 6 || 
		mx == 7) {
	    goto L540;
	}
 

 
 

	l2 = 1;
	i__2 = nmz;
	for (l = 3; l <= i__2; ++l) {
	    l1 = l - 2;
	    ab1[2] += l2 * (aa[l - 1] * ci[l1 - 1] + bb[l - 1] * cr[l1 - 1]);
	    ab2[2] += l2 * (aa[l - 1] * cr[l1 - 1] - bb[l - 1] * ci[l1 - 1]);
 
	    l2 = l2 * l / l1;
	}
L540:
	b[3] = b1 * sb1;
	b[30] = b2 * sb2;
	b[12] = b1 * sb2;
	b[21] = b2 * sb1;
	if (subres_ .nta > 4) {
	    goto L560;
	}
	if (mpe == 3 || mpe == 9 && nmz <= 3) {
	    goto L670;
	}
	if (mx == 2 || mx == 3 || mx == 4 || mx == 5 || mx == 6 || mx == 7) {
	    goto L560;
	}
 

 
 

	l2 = 1;
	i__2 = nmz;
	for (l = 4; l <= i__2; ++l) {
	    l1 = l - 3;
	    ab1[3] += l2 * (aa[l - 1] * ci[l1 - 1] + bb[l - 1] * cr[l1 - 1]);
	    ab2[3] += l2 * (aa[l - 1] * cr[l1 - 1] - bb[l - 1] * ci[l1 - 1]);
 
	    l2 = l2 * l / l1;
	}
L560:
	b[4] = b1 * b1;
	b[40] = b2 * b2;
	b[13] = b[12] * sb1;
	b[31] = b[21] * sb2;
	b[22] = b1 * b2;
	if (subres_ .nta > 5) {
	    goto L580;
	}
	if (mpe == 4 || mpe == 9 && nmz <= 4) {
	    goto L670;
	}
	if (mx == 3 || mx == 4 || mx == 5 || mx == 6 || mx == 7) {
	    goto L580;
	}
 

 
 

	l2 = 1;
	i__2 = nmz;
	for (l = 5; l <= i__2; ++l) {
	    l1 = l - 4;
	    ab1[4] += l2 * (aa[l - 1] * ci[l1 - 1] + bb[l - 1] * cr[l1 - 1]);
	    ab2[4] += l2 * (aa[l - 1] * cr[l1 - 1] - bb[l - 1] * ci[l1 - 1]);
 
	    l2 = l2 * l / l1;
	}
L580:
	b[5] = b[4] * sb1;
	b[50] = b[40] * sb2;
	b[14] = b[13] * sb1;
	b[41] = b[31] * sb2;
	b[23] = b[13] * sb2;
	b[32] = b[31] * sb1;
	if (subres_ .nta > 6) {
	    goto L600;
	}
	if (mpe == 5 || mpe == 9 && nmz <= 5) {
	    goto L670;
	}
	if (mx == 4 || mx == 5 || mx == 6 || mx == 7) {
	    goto L600;
	}
 

 
 

	l2 = 1;
	i__2 = nmz;
	for (l = 6; l <= i__2; ++l) {
	    l1 = l - 5;
	    ab1[5] += l2 * (aa[l - 1] * ci[l1 - 1] + bb[l - 1] * cr[l1 - 1]);
	    ab2[5] += l2 * (aa[l - 1] * cr[l1 - 1] - bb[l - 1] * ci[l1 - 1]);
 
	    l2 = l2 * l / l1;
	}
L600:
	b[6] = b[5] * sb1;
	b[60] = b[50] * sb2;
	b[15] = b[14] * sb1;
	b[51] = b[41] * sb2;
	b[24] = b[14] * sb2;
	b[42] = b[41] * sb1;
	b[33] = b[32] * sb1;
	if (subres_ .nta > 7) {
	    goto L620;
	}
	if (mpe == 6 || mpe == 9 && nmz <= 6) {
	    goto L670;
	}
	if (mx == 5 || mx == 6 || mx == 7) {
	    goto L620;
	}
 

 
 

	l2 = 1;
	i__2 = nmz;
	for (l = 7; l <= i__2; ++l) {
	    l1 = l - 6;
	    ab1[6] += l2 * (aa[l - 1] * ci[l1 - 1] + bb[l - 1] * cr[l1 - 1]);
	    ab2[6] += l2 * (aa[l - 1] * cr[l1 - 1] - bb[l - 1] * ci[l1 - 1]);
 
	    l2 = l2 * l / l1;
	}
L620:
	b[7] = b[6] * sb1;
	b[70] = b[60] * sb2;
	b[16] = b[6] * sb2;
	b[61] = b[60] * sb1;
	b[25] = b[24] * sb1;
	b[52] = b[42] * sb2;
	b[34] = b[33] * sb1;
	b[43] = b[33] * sb2;
	if (subres_ .nta > 8) {
	    goto L640;
	}
	if (mpe == 7 || mpe == 9 && nmz <= 7) {
	    goto L670;
	}
	if (mx == 6 || mx == 7) {
	    goto L640;
	}
 

 
 

	l2 = 1;
	i__2 = nmz;
	for (l = 8; l <= i__2; ++l) {
	    l1 = l - 7;
	    ab1[7] += l2 * (aa[l - 1] * ci[l1 - 1] + bb[l - 1] * cr[l1 - 1]);
	    ab2[7] += l2 * (aa[l - 1] * cr[l1 - 1] - bb[l - 1] * ci[l1 - 1]);
 
	    l2 = l2 * l / l1;
	}
L640:
	b[8] = b[7] * sb1;
	b[80] = b[70] * sb2;
	b[17] = b[7] * sb2;
	b[71] = b[70] * sb1;
	b[26] = b[16] * sb2;
	b[62] = b[61] * sb1;
	b[35] = b[25] * sb2;
	b[53] = b[52] * sb1;
	b[44] = b[43] * sb1;
	if (mpe == 8 || mpe == 9 && nmz <= 8) {
	    goto L670;
	}
	if (mx == 7) {
	    goto L660;
	}
 

 
 

	l2 = 1;
	i__2 = nmz;
	for (l = 9; l <= i__2; ++l) {
	    l1 = l - 8;
	    ab1[8] += l2 * (aa[l - 1] * ci[l1 - 1] + bb[l - 1] * cr[l1 - 1]);
	    ab2[8] += l2 * (aa[l - 1] * cr[l1 - 1] - bb[l - 1] * ci[l1 - 1]);
 
	    l2 = l2 * l / l1;
	}
L660:
	b[9] = b[8] * sb1;
	b[90] = b[80] * sb2;
	b[18] = b[8] * sb2;
	b[81] = b[80] * sb1;
	b[27] = b[17] * sb2;
	b[72] = b[71] * sb1;
	b[63] = b[62] * sb1;
	b[36] = b[26] * sb2;
	b[54] = b[53] * sb1;
	b[45] = b[35] * sb2;
 

L670:
	i__2 = mpe;
	for (np = 1; np <= i__2; ++np) {
	    n2e = np << 1;
	    i__3 = n2e;
	    for (nv = 1; nv <= i__3; ++nv) {
		n2 = nv - np;
		nn2 = (( n2 ) >= 0 ? ( n2 ) : -( n2 )) ;
		nn1 = np - nn2;
		re1 = nn1 * subres_ .qxt + n2 * subres_ .qzt;
		subres_ .ipt = 0;
		i__4 = secom1_ .nre;
		for (ii = 1; ii <= i__4; ++ii) {
 
		    if (n2 == secom1_ .nrr[ii - 1]) {
			subres_ .ipt = secom_ .ipr[ii - 1];
		    }
		}
		ip[np + nv * 10 - 11] = (integer) (re1 + .5) + subres_ .ipt;
		if (-re1 > 1e-17) {
		    ip[np + nv * 10 - 11] = -((integer) ((( re1 ) >= 0 ? ( re1 ) : -( re1 ))  + .5)) - 
			    subres_ .ipt;
		}
 
		re[np + nv * 10 - 11] = re1 - ip[np + nv * 10 - 11];
		res = re[np + nv * 10 - 11] / radi;
		chy[np + nv * 9 - 10] = cos(nn1 * phi[0] + n2 * phi[1] - res *
			 etl);
		shy[np + nv * 9 - 10] = sin(nn1 * phi[0] + n2 * phi[1] - res *
			 etl);
 
	    }
 
	}
	i__2 = mpe;
	for (np = subres_ .nta; np <= i__2; ++np) {
	    np2 = np;
	    nkk = 0;
L710:
	    ++nkk;
	    n2e = np2 << 1;
	    i__3 = nkk;
	    for (i__ = 1; i__ <= i__3; ++i__) {
		i__4 = n2e;
		for (nv = 1; nv <= i__4; ++nv) {
		    nn2 = (i__5 = nv - np2, (( i__5 ) >= 0 ? ( i__5 ) : -( i__5 )) );
		    nv1 = np2 - nn2 + (i__ - 1 << 1) + 1;
		    nv2 = np - nv1 + 2;
		    rn2 = nn2 * .5;
 
		    mm = 0;
		    gerad = rn2 - d_int(&rn2);
		    if ((( gerad ) >= 0 ? ( gerad ) : -( gerad ))  <= 1e-17) {
			mm = 1;
		    }
 
		    if (mm == 0) {
			goto L720;
		    }
		    btc = ab1[np - 1] * b[nv1 + nv2 * 10 - 11] * chy[np2 + nv 
			    * 9 - 10];
		    bts = ab1[np - 1] * b[nv1 + nv2 * 10 - 11] * shy[np2 + nv 
			    * 9 - 10];
		    goto L730;
L720:
		    btc = ab2[np - 1] * b[nv1 + nv2 * 10 - 11] * chy[np2 + nv 
			    * 9 - 10];
		    bts = ab2[np - 1] * b[nv1 + nv2 * 10 - 11] * shy[np2 + nv 
			    * 9 - 10];
L730:
		    secom_ .rtc[np2 + (nv + (np + i__ * 10) * 18) * 9 - 1792] 
			    += btc;
		    secom_ .rts[np2 + (nv + (np + i__ * 10) * 18) * 9 - 1792] 
			    += bts;
 
		}
 
	    }
	    np2 += -2;
	    if (np2 >= 1) {
		goto L710;
	    }
 
	}
L770:
	;
    }
    nnf[0] = 1;
    nnf[1] = 1;
    nnf[2] = 2;
    nz2[1] = 2;
    sea = sqrt(ep[0]);
    seb = sqrt(ep[1]);
    ea = ep[0];
    eb = ep[1];
    e[2] = 1. / eb;
    e[20] = 1. / ea;
    e[11] = 1. / seb / sea;
    nnf[3] = 6;
    nz2[2] = 4;
    e[3] = sea / eb;
    e[30] = seb / ea;
    e[12] = 1. / seb;
    e[21] = 1. / sea;
    nnf[4] = 24;
    nz2[3] = 8;
    e[4] = ea / eb;
    e[40] = eb / ea;
    e[13] = sea / seb;
    e[31] = seb / sea;
    e[22] = 1.;
    nnf[5] = 120;
    nz2[4] = 16;
    e[5] = e[4] * sea;
    e[50] = e[40] * seb;
    e[14] = ea / seb;
    e[41] = eb / sea;
    e[23] = sea;
    e[32] = seb;
    nnf[6] = 720;
    nz2[5] = 32;
    e[6] = e[5] * sea;
    e[60] = e[50] * seb;
    e[15] = e[14] * sea;
    e[51] = e[41] * seb;
    e[24] = ea;
    e[42] = eb;
    e[33] = sea * seb;
    nnf[7] = 5040;
    nz2[6] = 64;
    e[7] = e[6] * sea;
    e[70] = e[60] * seb;
    e[16] = e[15] * sea;
    e[61] = e[51] * seb;
    e[25] = ea * sea;
    e[52] = eb * seb;
    e[34] = ea * seb;
    e[43] = sea * eb;
    nnf[8] = 40320;
    nz2[7] = 128;
    e[8] = e[7] * sea;
    e[80] = e[70] * seb;
    e[17] = e[16] * sea;
    e[71] = e[61] * seb;
    e[26] = ea * ea;
    e[62] = eb * eb;
    e[35] = e[34] * sea;
    e[53] = e[43] * seb;
    e[44] = ea * eb;
    nnf[9] = 362880;
    nz2[8] = 256;
    e[9] = e[8] * sea;
    e[90] = e[80] * seb;
    e[18] = e[17] * sea;
    e[81] = e[71] * seb;
    e[27] = e[26] * sea;
    e[72] = e[62] * seb;
    e[36] = e[35] * sea;
    e[63] = e[53] * seb;
    e[45] = e[44] * sea;
    e[54] = e[44] * seb;
    i__1 = subres_ .nte;
    for (np = subres_ .nta; np <= i__1; ++np) {
	vdt1 = nnf[np - 1] / (nz2[np - 1] * kons_ .pi);
	np2 = np;
	nkk = 0;
L780:
	++nkk;
	n2e = np2 << 1;
	i__2 = nkk;
	for (i__ = 1; i__ <= i__2; ++i__) {
	    i__3 = n2e;
	    for (nv = 1; nv <= i__3; ++nv) {
		n2 = nv - np2;
		nn2 = (( n2 ) >= 0 ? ( n2 ) : -( n2 )) ;
		nn1 = np2 - nn2;
		nv1 = nn1 + (i__ - 1 << 1) + 1;
		nv2 = np - nv1 + 2;
		nv11 = nv1 - 1;
		nv21 = nv2 - 1;
		nf1 = nn1 + i__;
		nf3 = nkk - i__ + 1;
		nf4 = nf3 + nn2;
		vdt2 = vdt1 * e[nv1 + nv2 * 10 - 11] / (nnf[nf1 - 1] * nnf[
			i__ - 1] * nnf[nf3 - 1] * nnf[nf4 - 1]);
		vdt3 = nn2 * ea + nn1 * eb;
		if (n2 >= 0) {
		    vdt3 = n2 * nv21 * ea + nn1 * nv11 * eb;
		}
		secom_ .rtc[np2 + (nv + (np + i__ * 10) * 18) * 9 - 1792] = 
			secom_ .rtc[np2 + (nv + (np + i__ * 10) * 18) * 9 - 
			1792] * vdt2 * vdt3;
		secom_ .rts[np2 + (nv + (np + i__ * 10) * 18) * 9 - 1792] = 
			secom_ .rts[np2 + (nv + (np + i__ * 10) * 18) * 9 - 
			1792] * vdt2 * vdt3;
 
	    }
 
	}
	np2 += -2;
	if (np2 >= 1) {
	    goto L780;
	}
 
    }
    if (secom1_ .nur == 0) {
	goto L840;
    }
    i__1 = secom1_ .nur;
    for (j = 1; j <= i__1; ++j) {
	jk = j << 1;
	i__2 = secom1_ .nur;
	for (i__ = 1; i__ <= i__2; ++i__) {
	    jl = secom1_ .nu[i__ - 1] - secom1_ .npp - jk;
	    if (jl == 0) {
		min__[j - 1] = 1;
	    }
 
	    if (jl == 0) {
		goto L830;
	    }
	}
L830:
	;
    }
L840:
    m2 = secom1_ .npp + 2;
    m4 = secom1_ .npp + 4;
    m6 = secom1_ .npp + 6;
    i__1 = secom1_ .nre;
    for (i__ = 1; i__ <= i__1; ++i__) {
	i2 = i__ << 1;
	i1 = i2 - 1;
	n = secom1_ .nrr[i__ - 1] + secom1_ .npp;
	secom1_ .dtr[i1 - 1] = secom_ .rtc[secom1_ .npp + (n + (secom1_ .npp 
		+ 10) * 18) * 9 - 1792] + min__[0] * (- secom_ .rtc[
		secom1_ .npp + (n + (m2 + 10) * 18) * 9 - 1792] + secom_ .rtc[
		secom1_ .npp + (n + (m2 + 20) * 18) * 9 - 1792]) + min__[1] * 
		(secom_ .rtc[secom1_ .npp + (n + (m4 + 10) * 18) * 9 - 1792] 
		- secom_ .rtc[secom1_ .npp + (n + (m4 + 20) * 18) * 9 - 1792] 
		+ secom_ .rtc[secom1_ .npp + (n + (m4 + 30) * 18) * 9 - 1792])
		 + min__[2] * (- secom_ .rtc[secom1_ .npp + (n + (m6 + 10) * 
		18) * 9 - 1792] + secom_ .rtc[secom1_ .npp + (n + (m6 + 20) * 
		18) * 9 - 1792] - secom_ .rtc[secom1_ .npp + (n + (m6 + 30) * 
		18) * 9 - 1792] + secom_ .rtc[secom1_ .npp + (n + (m6 + 40) * 
		18) * 9 - 1792]);
	secom1_ .dtr[i2 - 1] = secom_ .rts[secom1_ .npp + (n + (secom1_ .npp 
		+ 10) * 18) * 9 - 1792] + min__[0] * (- secom_ .rts[
		secom1_ .npp + (n + (m2 + 10) * 18) * 9 - 1792] + secom_ .rts[
		secom1_ .npp + (n + (m2 + 20) * 18) * 9 - 1792]) + min__[1] * 
		(secom_ .rts[secom1_ .npp + (n + (m4 + 10) * 18) * 9 - 1792] 
		- secom_ .rts[secom1_ .npp + (n + (m4 + 20) * 18) * 9 - 1792] 
		+ secom_ .rts[secom1_ .npp + (n + (m4 + 30) * 18) * 9 - 1792])
		 + min__[2] * (- secom_ .rts[secom1_ .npp + (n + (m6 + 10) * 
		18) * 9 - 1792] + secom_ .rts[secom1_ .npp + (n + (m6 + 20) * 
		18) * 9 - 1792] - secom_ .rts[secom1_ .npp + (n + (m6 + 30) * 
		18) * 9 - 1792] + secom_ .rts[secom1_ .npp + (n + (m6 + 40) * 
		18) * 9 - 1792]);
 
    }
    return 0;
}  

doublereal resl6_(j)
integer *j;
{
     
    doublereal ret_val;

     
    static integer i__;

     
    --j;

     
    ret_val = 0.;
    for (i__ = 1; i__ <= 3; ++i__) {
	if (j[(i__ << 1) - 1] > j[i__ * 2]) {
	    goto L20;
	} else {
	    if (j[(i__ << 1) - 1] < j[i__ * 2]) {
		goto L771;
	    }
	}
 
    }
    ret_val = 1.;
    goto L771;
L20:
    ret_val = 1.;
L771:
    return ret_val;
}  

doublereal rext6_(j)
integer *j;
{
     
    doublereal ret_val;

     
    static integer i__, mo, lie;

     
    --j;

     
    lie = 0;
    for (i__ = 1; i__ <= 3; ++i__) {
 
	lie = istable_ .ista[i__ - 1] * j[i__ * 2] + lie;
    }
    mo = lie % 4 + 1;
    switch ((int)mo) {
	case 1:  goto L20;
	case 2:  goto L30;
	case 3:  goto L40;
	case 4:  goto L50;
    }
L20:
    ret_val = 1.;
    return ret_val;
L30:
    ret_val = -1.;
    return ret_val;
L40:
    ret_val = -1.;
    return ret_val;
L50:
    ret_val = 1.;
    return ret_val;
}  

 
 
  int ripple_(n)
integer *n;
{
     
    integer i__1;
    doublereal d__1;

     
    double cos();

     
    static integer i__, nripple;

 


 
 

 
 

    nripple = ripp2_ .nrturn + *n;
    i__1 = str_ .iu;
    for (i__ = 1; i__ <= i__1; ++i__) {
	if ((d__1 = rfres_ .rsmi[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
	    main1_ .smiv[i__ - 1] = rfres_ .rsmi[i__ - 1] * cos(kons_ .pi * 
		    2. * (nripple - 1) / rfres_ .rfres[i__ - 1] + 
		    rfres_ .rzphs[i__ - 1]);
	}
 
    }
    return 0;
}  

 
 
  int rmod_(dppr)
doublereal *dppr;
{
     
    static char fmt_10000[] = "(t5,\002---- ENTRY RMOD ----\002)";
    static char fmt_10010[] = "(/10x,\002N=\002,i1,\002 IS THE ORDER OF RESONACE, THAT WILL BE\002,\002 COMPENSATED\002//10x,\002L=\002,f15.6,\002; QX=\002,f10.5,\002; QZ=\002,f10.5,\002; AMAX=\002,f10.5)";
    static char fmt_10020[] = "(/10x,i1,\002 RESONANCE; NZ=\002,i2,\002;CHANGE OF P=\002,i2)";
    static char fmt_10030[] = "(/10x,\002NUMBER OF SUBRESONANCES THAT ARE CONSIDERED IS \002,i2)";
    static char fmt_10040[] = "(/10x,\002NU=\002,i2,\002 IS THE \002,i1,\002 SUBRESONANCE-MULTIPOLE-ORDER\002,i2)";
    static char fmt_10050[] = "(/10x,\002CHROMATICITY IS COMPENSATED\002)";
    static char fmt_10060[] = "(/10x,\002Q-VALUES ARE ADJUSTED\002)";
    static char fmt_10070[] = "(\002 \002,131(\002-\002))";
    static char fmt_10080[] = "(/10x,\002RESONANCE-CORRECTION     ITERATION #\002,i2//15x,\002DRIVING-TERM\002,13x,\002BEFORE         AFTER     COMPENSATION\002//10x,\002NZ=\002,i2,\002  COS-COMPONENT  \002,2g15.5/17x,\002SIN-COMPONENT  \002,2g15.5/)";
    static char fmt_10090[] = "(10x,\002NZ=\002,i2,\002  COS-COMPONENT  \002,2g15.5/17x,\002SIN-COMPONENT  \002,2g15.5/)";
    static char fmt_10100[] = "(10x,\002  ELEMENT NAME\002/)";
    static char fmt_10110[] = "(14x,a16,2x,g16.10,1x,g16.10/14x,a16,2x,g16.10,1x,g16.10)";
    static char fmt_10120[] = "(10x,\002CHROMATICITY-CORRECTION\002/15x,\002CHROMATICITY\002,13x,\002BEFORE         AFTER     COMPENSATION\002//19x,\002HORIZONTAL   \002,2g15.5/19x,\002VERTICAL     \002,2g15.5/10x,\002   SEXTUPOLE\002/)";
    static char fmt_10130[] = "(10x,\002Q-VARIATION\002/10x,\002Q-VALUE            THEORET.        AFTER     COMPENSATION\002/10x,\002HORIZONTAL     \002,2g15.7/10x,\002VERTICAL       \002,2g15.7/)";
    static char fmt_10140[] = "(10x,\002QUADRU.STRENGTH\002,2g15.8,\002   INDEX \002,i3/10x,\002               \002,2g15.8,\002         \002,i3)";

     
    integer i__1, i__2, i__3;
    doublereal d__1, d__2;

     
    integer s_wsfe(), e_wsfe(), do_fio();

     
    static integer i__, j, k, n;
    static doublereal d1[10];
    static integer i1, i2, j2, j1, j3, j4;
    static doublereal aa[100]	 , bb[10];
    static integer no;
    static doublereal sn[10], ss[10], ox, oz, de2;
    static integer jj1, jj2;
    static doublereal se2, dsm[10], sen[10], qwc[3];
    static integer irr[12], ntao, nteo;
    static doublereal dpp;
    static integer jjr;
    static doublereal se11, se12, sen15, sen16, sen17, sen18;
    static integer ierr;
    extern   int loesd_(), resex_(), error_(), clorb2_(), 
	    phasad_(), combel_();

     
    static cilist io___3760 = { 0, 6, 0, fmt_10000, 0 };
    static cilist io___3761 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___3764 = { 0, 6, 0, fmt_10020, 0 };
    static cilist io___3766 = { 0, 6, 0, fmt_10030, 0 };
    static cilist io___3767 = { 0, 6, 0, fmt_10040, 0 };
    static cilist io___3768 = { 0, 6, 0, fmt_10050, 0 };
    static cilist io___3776 = { 0, 6, 0, fmt_10060, 0 };
    static cilist io___3785 = { 0, 6, 0, fmt_10070, 0 };
    static cilist io___3786 = { 0, 6, 0, fmt_10080, 0 };
    static cilist io___3787 = { 0, 6, 0, fmt_10090, 0 };
    static cilist io___3788 = { 0, 6, 0, fmt_10100, 0 };
    static cilist io___3789 = { 0, 6, 0, fmt_10110, 0 };
    static cilist io___3790 = { 0, 6, 0, fmt_10110, 0 };
    static cilist io___3791 = { 0, 6, 0, fmt_10070, 0 };
    static cilist io___3792 = { 0, 6, 0, fmt_10120, 0 };
    static cilist io___3793 = { 0, 6, 0, fmt_10110, 0 };
    static cilist io___3794 = { 0, 6, 0, fmt_10070, 0 };
    static cilist io___3795 = { 0, 6, 0, fmt_10130, 0 };
    static cilist io___3796 = { 0, 6, 0, fmt_10140, 0 };
    static cilist io___3797 = { 0, 6, 0, fmt_10140, 0 };


 

 
 

 

    ntao = subres_ .nta;
    nteo = subres_ .nte;
    subres_ .nta = secom1_ .npp;
    subres_ .nte = secom1_ .npp;
    dpp = *dppr;
    for (i__ = 1; i__ <= 10; ++i__) {
	bb[i__ - 1] = 0.;
	dsm[i__ - 1] = 0.;
	sn[i__ - 1] = 0.;
	sen[i__ - 1] = 0.;
	ss[i__ - 1] = 0.;
	d1[i__ - 1] = 0.;
	for (j = 1; j <= 10; ++j) {
	    aa[i__ + j * 10 - 11] = 0.;
 
	}
    }
    for (i__ = 1; i__ <= 12; ++i__) {
	irr[i__ - 1] = 0;
 
    }
    for (i__ = 1; i__ <= 3; ++i__) {
	qwc[i__ - 1] = 0.;
 
    }
    k = 1;
    jj1 = 0;
    jj2 = 0;
    jjr = secom1_ .nre << 1;
    de2 = clo_ .de0 * .5;
    if (secom1_ .nre == 0) {
	goto L50;
    }
    s_wsfe(&io___3760);
    e_wsfe();
    s_wsfe(&io___3761);
    do_fio(&c__1, (char *)& secom1_ .npp, (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)& subres_ .totl, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)& subres_ .qxt, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)& subres_ .qzt, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)& subres_ .tam1, (ftnlen)sizeof(doublereal));
    e_wsfe();
    resex_(&dpp);
    i__1 = secom1_ .nre;
    for (i__ = 1; i__ <= i__1; ++i__) {
	i2 = i__ << 1;
	i1 = i2 - 1;
	irr[i1 - 1] = secom_ .ire[i1 - 1];
	irr[i2 - 1] = secom_ .ire[i2 - 1];
	sn[i1 - 1] = ell_ .ed[irr[i1 - 1] - 1];
	sn[i2 - 1] = ell_ .ed[irr[i2 - 1] - 1];
	dsm[i1 - 1] = clo_ .dsm0;
	dsm[i2 - 1] = clo_ .dsm0;
	s_wsfe(&io___3764);
	do_fio(&c__1, (char *)&i__, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)& secom1_ .nrr[i__ - 1], (ftnlen)sizeof(integer))
		;
	do_fio(&c__1, (char *)& secom_ .ipr[i__ - 1], (ftnlen)sizeof(integer));
	e_wsfe();
	sen[i1 - 1] = secom1_ .dtr[i1 - 1];
	bb[i1 - 1] = sen[i1 - 1];
	sen[i2 - 1] = secom1_ .dtr[i2 - 1];
	bb[i2 - 1] = sen[i2 - 1];
	ss[i1 - 1] = sen[i1 - 1];
	ss[i2 - 1] = sen[i2 - 1];
 
    }
    j2 = jjr;
L50:
    if (secom1_ .nur == 0) {
	goto L70;
    }
    s_wsfe(&io___3766);
    do_fio(&c__1, (char *)& secom1_ .nur, (ftnlen)sizeof(integer));
    e_wsfe();
    i__1 = secom1_ .nur;
    for (i__ = 1; i__ <= i__1; ++i__) {
	s_wsfe(&io___3767);
	do_fio(&c__1, (char *)& secom1_ .nu[i__ - 1], (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)&i__, (ftnlen)sizeof(integer));
	e_wsfe();
 
    }
L70:
    if (secom1_ .nch == 0) {
	goto L90;
    }
    s_wsfe(&io___3768);
    e_wsfe();
    j1 = j2 + 1;
    j2 += 2;
    irr[j1 - 1] = secom_ .ire[6];
    irr[j2 - 1] = secom_ .ire[7];
    sn[j1 - 1] = ell_ .ed[irr[j1 - 1] - 1];
    sn[j2 - 1] = ell_ .ed[irr[j2 - 1] - 1];
    dsm[j1 - 1] = clo_ .dsm0;
    dsm[j2 - 1] = clo_ .dsm0;
    se2 = 0.;
    se11 = 0.;
    se12 = 0.;
    for (n = 1; n <= 5; ++n) {
	dpp = de2 * (3 - n);
	clorb2_(&dpp);
	phasad_(&dpp, qwc);
	ox = qwc[0];
	oz = qwc[1];
	se2 += dpp * dpp;
	se11 += ox * dpp;
	se12 += oz * dpp;
 
    }
    sen[j1 - 1] = se11 / se2;
    sen[j2 - 1] = se12 / se2;
    bb[j1 - 1] = sen[j1 - 1];
    bb[j2 - 1] = sen[j2 - 1];
    ss[j1 - 1] = sen[j1 - 1];
    ss[j2 - 1] = sen[j2 - 1];
L90:
    if (secom1_ .nqc == 0) {
	goto L100;
    }
    s_wsfe(&io___3776);
    e_wsfe();
    j1 = j2 + 1;
    j2 += 2;
    jj1 = j1;
    jj2 = j2;
    irr[j1 - 1] = secom_ .ire[8];
    irr[j2 - 1] = secom_ .ire[9];
    if ((d__1 = ell_ .el[irr[j1 - 1] - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17 || (d__2 = 
	    ell_ .el[irr[j2 - 1] - 1], (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) ) <= 1e-17) {
	sn[j1 - 1] = ell_ .ed[irr[j1 - 1] - 1];
	sn[j2 - 1] = ell_ .ed[irr[j2 - 1] - 1];
    } else {
	sn[j1 - 1] = ell_ .ek[irr[j1 - 1] - 1];
	sn[j2 - 1] = ell_ .ek[irr[j2 - 1] - 1];
    }
    dsm[j1 - 1] = clo_ .dkq;
    dsm[j2 - 1] = clo_ .dkq;
    dpp = 0.;
    clorb2_(&dpp);
    phasad_(&dpp, qwc);
    sen[j1 - 1] = qwc[0];
    sen[j2 - 1] = qwc[1];
    bb[j1 - 1] = sen[j1 - 1] - qmodi_ .qw0[0];
    bb[j2 - 1] = sen[j2 - 1] - qmodi_ .qw0[1];
    ss[j1 - 1] = sen[j1 - 1];
    ss[j2 - 1] = sen[j2 - 1];
L100:
    i__1 = clo_ .itcro;
    for (no = 1; no <= i__1; ++no) {
	i__2 = j2;
	for (i__ = 1; i__ <= i__2; ++i__) {
	    if (i__ != jj1 && i__ != jj2) {
		ell_ .ed[irr[i__ - 1] - 1] += dsm[i__ - 1];
	    }
	    if (i__ == jj1 || i__ == jj2) {
		if ((d__1 = ell_ .el[irr[i__ - 1] - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
		    ell_ .ed[irr[i__ - 1] - 1] += dsm[i__ - 1];
		} else {
		    ell_ .ek[irr[i__ - 1] - 1] += dsm[i__ - 1];
		}
	    }
	    if (ell_ .kp[irr[i__ - 1] - 1] == 5) {
		combel_(&irr[i__ - 1]);
	    }
	    if (secom1_ .nre == 0) {
		goto L120;
	    }
	    resex_(&dpp);
	    i__3 = jjr;
	    for (j = 1; j <= i__3; ++j) {
		aa[i__ + j * 10 - 11] = (secom1_ .dtr[j - 1] - ss[j - 1]) / 
			dsm[i__ - 1];
 
	    }
L120:
	    if (secom1_ .nch == 0) {
		goto L140;
	    }
	    j3 = jjr + 1;
	    j4 = jjr + 2;
	    se2 = 0.;
	    se11 = 0.;
	    se12 = 0.;
	    for (n = 1; n <= 5; ++n) {
		dpp = de2 * (3 - n);
		clorb2_(&dpp);
		phasad_(&dpp, qwc);
		ox = qwc[0];
		oz = qwc[1];
		se2 += dpp * dpp;
		se11 += ox * dpp;
		se12 += oz * dpp;
 
	    }
	    sen15 = se11 / se2;
	    sen16 = se12 / se2;
	    aa[i__ + j3 * 10 - 11] = (sen15 - ss[j3 - 1]) / dsm[i__ - 1];
	    aa[i__ + j4 * 10 - 11] = (sen16 - ss[j4 - 1]) / dsm[i__ - 1];
L140:
	    if (secom1_ .nqc == 0) {
		goto L150;
	    }
	    dpp = 0.;
	    clorb2_(&dpp);
	    phasad_(&dpp, qwc);
	    sen17 = qwc[0];
	    sen18 = qwc[1];
	    aa[i__ + j1 * 10 - 11] = (sen17 - ss[j1 - 1]) / dsm[i__ - 1];
	    aa[i__ + j2 * 10 - 11] = (sen18 - ss[j2 - 1]) / dsm[i__ - 1];
L150:
	    if (i__ == jj1 || i__ == jj2) {
		if ((d__1 = ell_ .el[irr[i__ - 1] - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
		    ell_ .ed[irr[i__ - 1] - 1] -= dsm[i__ - 1];
		} else {
		    ell_ .ek[irr[i__ - 1] - 1] -= dsm[i__ - 1];
		}
	    }
	    if (i__ != jj1 && i__ != jj2) {
		ell_ .ed[irr[i__ - 1] - 1] -= dsm[i__ - 1];
	    }
	    if (ell_ .kp[irr[i__ - 1] - 1] == 5) {
		combel_(&irr[i__ - 1]);
	    }
 
	}
	loesd_(aa, bb, &j2, &c__10, &ierr);
	if (ierr == 1) {
	    error_(&c__38);
	}
	i__2 = j2;
	for (i__ = 1; i__ <= i__2; ++i__) {
	    if (i__ == jj1 || i__ == jj2) {
		if ((d__1 = ell_ .el[irr[i__ - 1] - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
		    ell_ .ed[irr[i__ - 1] - 1] -= bb[i__ - 1];
		} else {
		    ell_ .ek[irr[i__ - 1] - 1] -= bb[i__ - 1];
		}
	    }
	    if (i__ != jj1 && i__ != jj2) {
		ell_ .ed[irr[i__ - 1] - 1] -= bb[i__ - 1];
	    }
	    if (ell_ .kp[irr[i__ - 1] - 1] == 5) {
		combel_(&irr[i__ - 1]);
	    }
 
	}
	if (secom1_ .nre == 0) {
	    goto L190;
	}
	resex_(&dpp);
	i__2 = jjr;
	for (i__ = 1; i__ <= i__2; ++i__) {
	    ss[i__ - 1] = secom1_ .dtr[i__ - 1];
 
	    d1[i__ - 1] = (d__1 = ss[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
	}
L190:
	if (secom1_ .nch == 0) {
	    goto L210;
	}
	se2 = 0.;
	se11 = 0.;
	se12 = 0.;
	for (n = 1; n <= 5; ++n) {
	    dpp = de2 * (3 - n);
	    clorb2_(&dpp);
	    phasad_(&dpp, qwc);
	    ox = qwc[0];
	    oz = qwc[1];
	    se2 += dpp * dpp;
	    se11 += ox * dpp;
	    se12 += oz * dpp;
 
	}
	ss[j3 - 1] = se11 / se2;
	ss[j4 - 1] = se12 / se2;
	d1[j3 - 1] = (d__1 = ss[j3 - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
	d1[j4 - 1] = (d__1 = ss[j4 - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
L210:
	if (secom1_ .nqc == 0) {
	    goto L220;
	}
	dpp = 0.;
	clorb2_(&dpp);
	phasad_(&dpp, qwc);
	ss[j1 - 1] = qwc[0];
	ss[j2 - 1] = qwc[1];
	d1[j1 - 1] = (d__1 = qwc[0] - qmodi_ .qw0[0], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
	d1[j2 - 1] = (d__1 = qwc[1] - qmodi_ .qw0[1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
L220:
	s_wsfe(&io___3785);
	e_wsfe();
	if (secom1_ .nre == 0) {
	    goto L270;
	}
	s_wsfe(&io___3786);
	do_fio(&c__1, (char *)&no, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)& secom1_ .nrr[0], (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)&sen[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&ss[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&sen[1], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&ss[1], (ftnlen)sizeof(doublereal));
	e_wsfe();
	if (secom1_ .nre == 1) {
	    goto L240;
	}
	i__2 = secom1_ .nre;
	for (i__ = 2; i__ <= i__2; ++i__) {
	    i2 = i__ << 1;
	    i1 = i2 - 1;
 
	    s_wsfe(&io___3787);
	    do_fio(&c__1, (char *)& secom1_ .nrr[i__ - 1], (ftnlen)sizeof(
		    integer));
	    do_fio(&c__1, (char *)&sen[i1 - 1], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&ss[i1 - 1], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&sen[i2 - 1], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&ss[i2 - 1], (ftnlen)sizeof(doublereal));
	    e_wsfe();
	}
L240:
	s_wsfe(&io___3788);
	e_wsfe();
	s_wsfe(&io___3789);
	do_fio(&c__1, linopc_ .bez + (irr[0] - 1 << 4), 16L);
	do_fio(&c__1, (char *)&sn[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& ell_ .ed[irr[0] - 1], (ftnlen)sizeof(
		doublereal));
	do_fio(&c__1, linopc_ .bez + (irr[1] - 1 << 4), 16L);
	do_fio(&c__1, (char *)&sn[1], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& ell_ .ed[irr[1] - 1], (ftnlen)sizeof(
		doublereal));
	e_wsfe();
	if (secom1_ .nre == 1) {
	    goto L260;
	}
	i__2 = secom1_ .nre;
	for (i__ = 2; i__ <= i__2; ++i__) {
	    i2 = i__ << 1;
	    i1 = i2 - 1;
 
	    s_wsfe(&io___3790);
	    do_fio(&c__1, linopc_ .bez + (irr[i1 - 1] - 1 << 4), 16L);
	    do_fio(&c__1, (char *)&sn[i1 - 1], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& ell_ .ed[irr[i1 - 1] - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, linopc_ .bez + (irr[i2 - 1] - 1 << 4), 16L);
	    do_fio(&c__1, (char *)&sn[i2 - 1], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& ell_ .ed[irr[i2 - 1] - 1], (ftnlen)sizeof(
		    doublereal));
	    e_wsfe();
	}
L260:
	s_wsfe(&io___3791);
	e_wsfe();
L270:
	if (secom1_ .nch == 0) {
	    goto L280;
	}
	s_wsfe(&io___3792);
	do_fio(&c__1, (char *)&sen[j3 - 1], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&ss[j3 - 1], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&sen[j4 - 1], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&ss[j4 - 1], (ftnlen)sizeof(doublereal));
	e_wsfe();
	s_wsfe(&io___3793);
	do_fio(&c__1, linopc_ .bez + (irr[j3 - 1] - 1 << 4), 16L);
	do_fio(&c__1, (char *)&sn[j3 - 1], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& ell_ .ed[irr[j3 - 1] - 1], (ftnlen)sizeof(
		doublereal));
	do_fio(&c__1, linopc_ .bez + (irr[j4 - 1] - 1 << 4), 16L);
	do_fio(&c__1, (char *)&sn[j4 - 1], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& ell_ .ed[irr[j4 - 1] - 1], (ftnlen)sizeof(
		doublereal));
	e_wsfe();
	s_wsfe(&io___3794);
	e_wsfe();
L280:
	if (secom1_ .nqc == 0) {
	    goto L290;
	}
	s_wsfe(&io___3795);
	do_fio(&c__1, (char *)& qmodi_ .qw0[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&qwc[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& qmodi_ .qw0[1], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&qwc[1], (ftnlen)sizeof(doublereal));
	e_wsfe();
	if ((d__1 = ell_ .el[irr[j1 - 1] - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    s_wsfe(&io___3796);
	    do_fio(&c__1, (char *)&sn[j1 - 1], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& ell_ .ed[irr[j1 - 1] - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)&irr[j1 - 1], (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&sn[j2 - 1], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& ell_ .ed[irr[j2 - 1] - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)&irr[j2 - 1], (ftnlen)sizeof(integer));
	    e_wsfe();
	} else {
	    s_wsfe(&io___3797);
	    do_fio(&c__1, (char *)&sn[j1 - 1], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& ell_ .ek[irr[j1 - 1] - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)&irr[j1 - 1], (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&sn[j2 - 1], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& ell_ .ek[irr[j2 - 1] - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)&irr[j2 - 1], (ftnlen)sizeof(integer));
	    e_wsfe();
	}
L290:
	i__2 = j2;
	for (i__ = 1; i__ <= i__2; ++i__) {
 
	    if (d1[i__ - 1] > clo_ .dsi) {
		goto L310;
	    }
	}
	subres_ .nta = ntao;
	subres_ .nte = nteo;
	return 0;
L310:
	i__2 = j2;
	for (i__ = 1; i__ <= i__2; ++i__) {
 
	    bb[i__ - 1] = ss[i__ - 1];
	}
	if (secom1_ .nqc == 1) {
	    bb[j1 - 1] -= qmodi_ .qw0[0];
	}
	if (secom1_ .nqc == 1) {
	    bb[j2 - 1] -= qmodi_ .qw0[1];
	}
 
    }
    subres_ .nta = ntao;
    subres_ .nte = nteo;
 

    return 0;
}  

 
  int rotatio6_()
{
     
    double cos(), sin();

     
    static integer i__, j[20];
    static doublereal ch, co[3];
    static integer fs, hs;
    static doublereal si[3], sh, sim, simv;
    extern   int daall_(), dacop_(), dapok_(), hyper6_();

 
 
 




    daall_(& nom_ .bb1, &c__1, "BB1       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(& nom_ .bb2, &c__1, "BB2       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(nom_ .rot, &c__12, "ROT       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(nom_ .roti, &c__12, "ROTI      ", & ii_ .no, & ii_ .nv, 10L);
    daall_(nom_ .rel, &c__12, "REL       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&fs, &c__1, "FS        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(nom_ .ctr, &c__12, "CTR       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(nom_ .cjg, &c__12, "CJG       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(nom_ .rtc, &c__12, "RTC       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(vecteur_ .a2, &c__12, "A2        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(vecteur_ .a2i, &c__12, "A2I       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(vecteur_ .cm, &c__12, "CM        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(vecteur_ .a1, &c__12, "A1        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(vecteur_ .v, &c__12, "V         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(vecteur_ .w, &c__12, "W         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(vecteur_ .x, &c__12, "X         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(vecteur_ .xy, &c__12, "XY        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(& vecteur_ .h__, &c__1, "H         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(& vecteur_ .ft, &c__1, "FT        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(vecteur_ .a1i, &c__12, "A1I       ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&hs, &c__1, "HS        ", & ii_ .no, & ii_ .nv, 10L);
 
    for (i__ = 1; i__ <= 3; ++i__) {
	if (istable_ .ista[i__ - 1] == 0) {
	    hyper6_(& tune_ .angle[i__ - 1], &ch, &sh);
	    co[i__ - 1] = ch;
	    si[i__ - 1] = -sh;
	} else {
	    co[i__ - 1] = cos(tune_ .angle[i__ - 1]);
	    si[i__ - 1] = sin(tune_ .angle[i__ - 1]);
	}
 
    }
    for (i__ = 1; i__ <= 3; ++i__) {
	if (istable_ .ista[i__ - 1] == 0) {
	    sim = si[i__ - 1];
	} else {
	    sim = -si[i__ - 1];
	}
	j[(i__ << 1) - 2] = 1;
	dapok_(& nom_ .rot[(i__ << 1) - 2], j, &co[i__ - 1]);
	dapok_(& nom_ .rot[(i__ << 1) - 1], j, &sim);
	dapok_(& nom_ .roti[(i__ << 1) - 2], j, &co[i__ - 1]);
	simv = -sim;
	dapok_(& nom_ .roti[(i__ << 1) - 1], j, &simv);
	j[(i__ << 1) - 2] = 0;
	j[(i__ << 1) - 1] = 1;
	simv = -si[i__ - 1];
	dapok_(& nom_ .rot[(i__ << 1) - 1], j, &co[i__ - 1]);
	dapok_(& nom_ .rot[(i__ << 1) - 2], j, &si[i__ - 1]);
	dapok_(& nom_ .roti[(i__ << 1) - 1], j, &co[i__ - 1]);
	dapok_(& nom_ .roti[(i__ << 1) - 2], j, &simv);
 
	j[(i__ << 1) - 1] = 0;
    }
    for (i__ = 1; i__ <= 3; ++i__) {
	if (istable_ .ista[i__ - 1] == 1) {
	    dacop_(& nom_ .rel[(i__ << 1) - 2], & nom_ .cjg[(i__ << 1) - 1]);
	    dacop_(& nom_ .rel[(i__ << 1) - 1], & nom_ .cjg[(i__ << 1) - 2]);
	} else {
	    dacop_(& nom_ .rel[(i__ << 1) - 2], & nom_ .cjg[(i__ << 1) - 2]);
	    dacop_(& nom_ .rel[(i__ << 1) - 1], & nom_ .cjg[(i__ << 1) - 1]);
	}
 
    }
    return 0;
}  

 
 
  int search_(dpp)
doublereal *dpp;
{
     
    static char fmt_10010[] = "(1x,131(\002-\002))";
    static char fmt_10000[] = "(t5,\002---- ENTRY SEARCH ----\002)";
    static char fmt_10020[] = "(10x,///\002RESONANCES OF ORDER\002,i4,\002  ARE CONSIDERED\002//)";
    static char fmt_10030[] = "(24x,\002|\002,6x,\002NZ =\002,i4,\002;D-P= \002,i4,7x,\002|\002,6x,\002NZ =\002,i4,\002;D-P= \002,i4,7x,\002|\002,6x,\002NZ =\002,i4,\002;D-P= \002,i4,7x,\002|\002)";
    static char fmt_10040[] = "(1x,\002ELEMENT          | POS |\002,6x,\002COS\002,13x,\002SIN\002,6x,\002|\002,6x,\002COS\002,13x,\002SIN\002,6x,\002|\002,6x,\002COS\002,13x,\002SIN\002,6x,\002|\002)";
    static char fmt_10050[] = "(1x,a16,1x,\002|\002,i3,\002  |\002,g15.5,\002|\002,g15.5,\002|\002,g15.5,\002|\002,g15.5,\002|\002,g15.5,\002|\002,g15.5,\002|\002)";

     
    integer i__1;

     
      int s_copy();
    integer s_wsfe(), e_wsfe(), do_fio();

     
    static doublereal b, c__, d__, e, f, g;
    static integer i__;
    static doublereal c1, c2, c3, s1, s2, s3;
    static integer id, n21, n22, n23;
    static char ref[16];
    static integer ntao, nteo;
    extern   int combel_(), subsea_();

     
    static cilist io___3812 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___3813 = { 0, 6, 0, fmt_10000, 0 };
    static cilist io___3814 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___3815 = { 0, 6, 0, fmt_10020, 0 };
    static cilist io___3816 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___3817 = { 0, 6, 0, fmt_10030, 0 };
    static cilist io___3818 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___3819 = { 0, 6, 0, fmt_10040, 0 };
    static cilist io___3820 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___3830 = { 0, 6, 0, fmt_10050, 0 };
    static cilist io___3838 = { 0, 6, 0, fmt_10050, 0 };


 

 
 

 

    ntao = subres_ .nta;
    nteo = subres_ .nte;
    subres_ .nta = sea_ .mp;
    subres_ .nte = sea_ .mp;
    s_copy(ref, "REFERENCE       ", 16L, 16L);
    id = 0;
    s_wsfe(&io___3812);
    e_wsfe();
    s_wsfe(&io___3813);
    e_wsfe();
    s_wsfe(&io___3814);
    e_wsfe();
    s_wsfe(&io___3815);
    do_fio(&c__1, (char *)& sea_ .mp, (ftnlen)sizeof(integer));
    e_wsfe();
    s_wsfe(&io___3816);
    e_wsfe();
    s_wsfe(&io___3817);
    do_fio(&c__1, (char *)& sea_ .m21, (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)& sea_ .ise1, (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)& sea_ .m22, (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)& sea_ .ise2, (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)& sea_ .m23, (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)& sea_ .ise3, (ftnlen)sizeof(integer));
    e_wsfe();
    s_wsfe(&io___3818);
    e_wsfe();
    s_wsfe(&io___3819);
    e_wsfe();
    s_wsfe(&io___3820);
    e_wsfe();
    n21 = sea_ .m21 + sea_ .mp;
    n22 = sea_ .m22 + sea_ .mp;
    n23 = sea_ .m23 + sea_ .mp;
    subres_ .ipt = sea_ .ise1;
    subsea_(dpp);
    c1 = secom_ .rtc[sea_ .mp + (n21 + (sea_ .mp + 10) * 18) * 9 - 1792];
    s1 = secom_ .rts[sea_ .mp + (n21 + (sea_ .mp + 10) * 18) * 9 - 1792];
    subres_ .ipt = sea_ .ise2;
    subsea_(dpp);
    c2 = secom_ .rtc[sea_ .mp + (n22 + (sea_ .mp + 10) * 18) * 9 - 1792];
    s2 = secom_ .rts[sea_ .mp + (n22 + (sea_ .mp + 10) * 18) * 9 - 1792];
    subres_ .ipt = sea_ .ise3;
    subsea_(dpp);
    c3 = secom_ .rtc[sea_ .mp + (n23 + (sea_ .mp + 10) * 18) * 9 - 1792];
    s3 = secom_ .rts[sea_ .mp + (n23 + (sea_ .mp + 10) * 18) * 9 - 1792];
    s_wsfe(&io___3830);
    do_fio(&c__1, ref, 16L);
    do_fio(&c__1, (char *)&id, (ftnlen)sizeof(integer));
    do_fio(&c__1, (char *)&c1, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)&s1, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)&c2, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)&s2, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)&c3, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)&s3, (ftnlen)sizeof(doublereal));
    e_wsfe();
    i__1 = sea_ .mesa;
    for (i__ = 1; i__ <= i__1; ++i__) {
	ell_ .ed[sea_ .isea[i__ - 1] - 1] += clo_ .dsm0;
	if (ell_ .kp[sea_ .isea[i__ - 1] - 1] == 5) {
	    combel_(& sea_ .isea[i__ - 1]);
	}
	subres_ .ipt = sea_ .ise1;
	subsea_(dpp);
	b = secom_ .rtc[sea_ .mp + (n21 + (sea_ .mp + 10) * 18) * 9 - 1792] - 
		c1;
	c__ = secom_ .rts[sea_ .mp + (n21 + (sea_ .mp + 10) * 18) * 9 - 1792] 
		- s1;
	subres_ .ipt = sea_ .ise2;
	subsea_(dpp);
	d__ = secom_ .rtc[sea_ .mp + (n22 + (sea_ .mp + 10) * 18) * 9 - 1792] 
		- c2;
	e = secom_ .rts[sea_ .mp + (n22 + (sea_ .mp + 10) * 18) * 9 - 1792] - 
		s2;
	subres_ .ipt = sea_ .ise3;
	subsea_(dpp);
	f = secom_ .rtc[sea_ .mp + (n23 + (sea_ .mp + 10) * 18) * 9 - 1792] - 
		c3;
	g = secom_ .rts[sea_ .mp + (n23 + (sea_ .mp + 10) * 18) * 9 - 1792] - 
		s3;
	s_wsfe(&io___3838);
	do_fio(&c__1, linopc_ .bez + (sea_ .isea[i__ - 1] - 1 << 4), 16L);
	do_fio(&c__1, (char *)&i__, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)&b, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&c__, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&d__, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&e, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&f, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&g, (ftnlen)sizeof(doublereal));
	e_wsfe();
	ell_ .ed[sea_ .isea[i__ - 1] - 1] -= clo_ .dsm0;
	if (ell_ .kp[sea_ .isea[i__ - 1] - 1] == 5) {
	    combel_(& sea_ .isea[i__ - 1]);
	}
 
    }
    subres_ .nta = ntao;
    subres_ .nte = nteo;
 

    return 0;
}  

 
 
  int sinpro_(a, b, c__, d__, e)
doublereal *a, *b, *c__, *d__, *e;
{
     
    double sqrt();

 

    if ((( *a ) >= 0 ? ( *a ) : -( *a ))  > 1e-17) {
	if (*c__ > 1e-17 && *b > 1e-17) {
	    *c__ = sqrt(*c__ / *b) / *a * 100;
	} else {
	    *c__ = 0.;
	}
	*d__ = (*d__ - *a) / *a * 100;
	*e = (*e - *a) / *a * 100;
    } else {
	*c__ = 0.;
	*d__ = 0.;
	*e = 0.;
    }
    return 0;
}  

 
 
  int sixdaco6_(isixda)
integer *isixda;
{
     
    integer s_wsle(), do_lio(), e_wsle();

     
    extern   int clor6_(), dadal_(), daall_(), daini_(), 
	    daeps_(), umlau6_();

     
    static cilist io___3839 = { 0, 6, 0, 0, 0 };
    static cilist io___3840 = { 0, 6, 0, 0, 0 };


 

 
 

    s_wsle(&io___3839);
    do_lio(&c__9, &c__1, " ENTERING INITIALIZATION OF DA FOR 6-D CO ", 42L);
    e_wsle();
    daini_(& dial_ .nord, & dial_ .nvar, &c__0);
    s_wsle(&io___3840);
    do_lio(&c__9, &c__1, " NO,NV = ", 9L);
    do_lio(&c__3, &c__1, (char *)& dial_ .nord, (ftnlen)sizeof(integer));
    do_lio(&c__3, &c__1, (char *)& dial_ .nvar, (ftnlen)sizeof(integer));
    e_wsle();
    daall_(dascr_ .iscrda, &c__100, "$$IS      ", & dial_ .nord, & dial_ .nvar, 
	    10L);
    daeps_(& dial_ .preda);
    if (*isixda == 1) {
	clor6_();
    }
    if (*isixda == 2) {
	umlau6_();
    }
    dadal_(dascr_ .iscrda, &c__100);
    return 0;
}  

 
 
  int subre_(dpp)
doublereal *dpp;
{
     
    static char fmt_10030[] = "(131(\002-\002))";
    static char fmt_10020[] = "(t5,\002---- ENTRY SUBRES ----\002)";
    static char fmt_10120[] = "(t8,\002  PLANE     DISP(MM)     DISP(MRAD)   \002/t6,\002      X  \002,2(f12.3,3x)/t10,\002  Z  \002,2(f12.3,3x)/)";
    static char fmt_10070[] = "(\002 \002/10x,\002RELATIVE ENERGY DEVIATION  \002,t40,f10.7/10x,\002TUNES -HORIZONTAL\002,t40,f10.7/10x,\002      -VERTICAL  \002,t40,f10.7)";
    static char fmt_10040[] = "(\002 \002,\002  NR  TYP      L-TOTAL  LENGTH   BETAH  ALFAH  \002,\002 PHIH   DISH  DISPH   CLOH  CLOPH\002,\002   BETAV  ALFAV   PHIV   DISV  DISPV   CLOV  CLOPV\002/1x,\002                 (M)      (M)     (M)           \002,\002(QE)   (M)   (RAD)   (MM) (MRAD)\002,\002    (M)           (QE)   (M)   (RAD)   (MM) (MRAD)\002)";
    static char fmt_10010[] = "(1x,i4,1x,a8,1x,f8.2,1x,f7.3,1x,f7.2,1x,f6.2,1x,f6.2,1x,f6.2,1x,f6.3,1x,f6.2,1x,f6.3,1x,f7.2,1x,f6.2,1x,f6.2,1x,f6.2,1x,f6.3,1x,f6.2,1x,f6.3)";
    static char fmt_10050[] = "(//7x,\002INIT. X-AMPLITUDE=\002,g15.8,\002X-EMITTANCE=\002,g15.8,/40x,/7x,\002INIT. Z-AMPLITUDE=\002,g15.8,\002Z-EMITTANCE=\002,g15.8,\002UNITS ARE (PI X MM X MRAD)\002//)";
    static char fmt_10000[] = "(1x,i4,27x,f7.2,1x,f6.2,1x,f6.2,1x,f6.2,1x,f6.3,1x,f6.2,1x,f6.3,1x,f7.2,1x,f6.2,1x,f6.2,1x,f6.2,1x,f6.3,1x,f6.2,1x,f6.3)";
    static char fmt_10110[] = "(/10x,\002PRECISE LENGTH OF THE MACHINE : \002,f43.33//10x,\002   PRECISE HORIZONTAL Q-VALUE : \002,f43.33//10x,\002     PRECISE VERTICAL Q-VALUE : \002,f43.33/)";
    static char fmt_10150[] = "(\002 \002/10x,\002NONLINEAR DETUNING  \002//10x,\002CHANGE IN QX\002/10x,\002 4. ORDER \002,f15.12/10x,\002 6. ORDER \002,f15.12/10x,\002 8. ORDER \002,f15.12/10x,\00210. ORDER \002,f15.12/10x,\002   TOTAL  \002,f15.12/10x,\002CHANGE IN QZ\002/10x,\002 4. ORDER \002,f15.12/10x,\002 6. ORDER \002,f15.12/10x,\002 8. ORDER \002,f15.12/10x,\00210. ORDER \002,f15.12/10x,\002   TOTAL  \002,f15.12//10x,\002DETUNING ORDER BY ORDER\002//10x,\002Qx - COEFFICIENT   Ex  Ez\002/10x,\002-------------------------\002)";
    static char fmt_10160[] = "(\002 \002/10x,\002Qz - COEFFICIENT   Ex  Ez\002/10x,\002-------------------------\002)";
    static char fmt_10060[] = "(//10x,\002E=NX*QX+NZ*QZ-P\002,//10x,\002CLOSESET P-VALUE CHANGED \002,\002BY D-P\002,//10x,\002DELTA-E STANDS FOR THE RESONANCE-WIDTH\002//10x)";
    static char fmt_10080[] = "(/10x,\002RESONANCE EXCITING MULTIPOLE-ORDER = \002,i2)";
    static char fmt_10090[] = "(//20x,\002RESONANCE-ORDER =\002,i2/20x,100(\002-\002)/20x,\002| NZ |\002,\002   P  | D-P |\002,2x,\002DRIVING-COS \002,3x,\002|\002,2x,\002DRIVING-SIN \002,3x,\002|\002,8x,\002E\002,8x,\002|\002,5x,\002DELTA-E\002,5x,\002|\002)";
    static char fmt_10100[] = "(//20x,\002RESONANCE-ORDER =\002,i2,5x,\002SUBRESONANCE-ORDER = \002,i2,/20x,100(\002-\002)/20x,\002| NZ |\002,\002   P  | D-P |\002,2x,\002DRIVING-COS \002,3x,\002|\002,2x,\002DRIVING-SIN \002,3x,\002|\002,8x,\002E\002,8x,\002|\002,5x,\002DELTA-E\002,5x,\002|\002)";
    static char fmt_10140[] = "(20x,\002| \002,i2,\002 | \002,i4,\002 | \002,i3,\002 |\002,g16.8,\002 |\002,g16.8,\002 |\002,g16.8,\002 |\002,g16.8,\002 |\002)";
    static char fmt_10130[] = "(//10x,\002E=NX*QX+NZ*QZ-P\002,//10x,\002CLOSESET P-VALUE CHANGED \002,\002BY D-P\002,//10x,\002DELTA-E STANDS FOR THE RESONANCE-WIDTH\002//10x,\002!!!! ALL SUBRESONANCES ARE INCLUDED !!!! \002)";

     
    integer i__1, i__2, i__3, i__4, i__5, i__6;
    doublereal d__1;

     
    integer s_wsfe(), e_wsfe(), do_fio();
    double atan(), sqrt(), cos(), sin(), d_int();

     
    static doublereal tiltckuk, b[100]	 , e[100]	 
;
    static integer i__, j, k, l;
    static doublereal t[24]	 , b1, b2;
    static integer k1, l1, l2, n2;
    static doublereal r0, aa[11], bb[11], ea, eb, cc;
    static integer dj;
    static doublereal ep[2], re[180]	 ;
    static integer ip[180]	 ;
    static doublereal cr[11], qw[2], ci[11], dt;
    static integer ns, ik, ii, nr, ll, ix, jj, jm, jk;
    static doublereal ab1[10], ab2[10], qu, qv, xs, zs, xl, zl;
    static integer mx, im;
    static doublereal r0a;
    static integer iv;
    static doublereal sb1, sb2;
    static integer np, n2e, nv, nn1, nn2;
    static doublereal re1;
    static integer np2, mm;
    static doublereal rn2;
    static integer nf1, nf3, nv1, nv2;
    static doublereal qu1;
    static integer nz2[9], nf4;
    static doublereal rc, rs;
    static integer n22;
    static doublereal ss, alfa[2], phi[2], clo0[2], beta[2], clop0[2], qwc[3],
	     dpr[6];
    static integer nnf[10];
    static doublereal chy[162]	 , shy[162]	 
, dfac[10], dtu[10]	 , dtup[250]	 
, phibf[2];
    static integer ium, ipl;
    static doublereal gtu1, gtu2;
    static integer ipcc, ipc;
    static doublereal btc, bts, phy, del, pie, etl, radi, dpp1;
    extern   int clorb_(), error_(), envar_();
    static integer izu;
    static doublereal dphi, puf;
    static integer kpz, kzz;
    static doublereal dyy1, dyy2, ekk, crkve, cikve;
    static integer mpe;
    static doublereal cxzr, cxzi, cxzyr, cxzyi, ekko, dppi;
    static integer nmz;
    static doublereal benkr;
    static integer lmin;
    static doublereal dyy11, res;
    static integer nkk;
    static doublereal gerad, sea, seb, vdt1;
    static integer nv11, nv21;
    static doublereal vdt2, vdt3, vdt4;
    static integer mis;
    static doublereal sdel2;
    static integer ntx, nph, min1, min2;
    extern   int betalf_();
    static doublereal sdel;
    extern   int phasad_(), detune_();
    static doublereal tiltck, tiltsk, cxzyrr, tiltck1, tiltck2, tiltck3, 
	    tiltck4, tiltck5, tiltck6, tiltck8, tiltsk1, tiltsk2, tiltsk3, 
	    tiltsk4, tiltsk5, tiltsk6, tiltsk8, tiltck10, tiltsk10;

     
    static cilist io___3885 = { 0, 6, 0, fmt_10030, 0 };
    static cilist io___3886 = { 0, 6, 0, fmt_10020, 0 };
    static cilist io___3892 = { 0, 6, 0, fmt_10030, 0 };
    static cilist io___3893 = { 0, 6, 0, fmt_10120, 0 };
    static cilist io___3894 = { 0, 6, 0, fmt_10070, 0 };
    static cilist io___3896 = { 0, 6, 0, fmt_10030, 0 };
    static cilist io___3897 = { 0, 6, 0, fmt_10040, 0 };
    static cilist io___3898 = { 0, 6, 0, fmt_10030, 0 };
    static cilist io___3899 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___3900 = { 0, 6, 0, fmt_10050, 0 };
    static cilist io___3901 = { 0, 6, 0, fmt_10030, 0 };
    static cilist io___3988 = { 0, 6, 0, fmt_10000, 0 };
    static cilist io___3989 = { 0, 6, 0, fmt_10030, 0 };
    static cilist io___3990 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___3991 = { 0, 6, 0, fmt_10030, 0 };
    static cilist io___3992 = { 0, 6, 0, fmt_10110, 0 };
    static cilist io___3993 = { 0, 6, 0, fmt_10030, 0 };
    static cilist io___3994 = { 0, 6, 0, fmt_10150, 0 };
    static cilist io___3995 = { 0, 6, 0, fmt_10160, 0 };
    static cilist io___3996 = { 0, 6, 0, "(10X,G16.10,3X,I2,2X,I2)", 0 };
    static cilist io___3997 = { 0, 6, 0, fmt_10060, 0 };
    static cilist io___3998 = { 0, 6, 0, fmt_10030, 0 };
    static cilist io___3999 = { 0, 6, 0, fmt_10080, 0 };
    static cilist io___4000 = { 0, 6, 0, fmt_10030, 0 };
    static cilist io___4002 = { 0, 6, 0, fmt_10090, 0 };
    static cilist io___4003 = { 0, 6, 0, fmt_10100, 0 };
    static cilist io___4017 = { 0, 6, 0, fmt_10140, 0 };
    static cilist io___4019 = { 0, 6, 0, fmt_10130, 0 };
    static cilist io___4020 = { 0, 6, 0, fmt_10090, 0 };
    static cilist io___4027 = { 0, 6, 0, fmt_10140, 0 };


 

 
 

 

    ium = 5;
    ipl = 1;
    gtu1 = 0.;
    gtu2 = 0.;
    dfac[0] = 1.;
    dfac[1] = 1.;
    dfac[2] = 2.;
    dfac[3] = 6.;
    dfac[4] = 24.;
    dfac[5] = 120.;
    dfac[6] = 720.;
    dfac[7] = 5040.;
    dfac[8] = 40320.;
    dfac[9] = 362880.;
    if (subres_ .ipt == 1) {
	ipl = 3;
    }
    i__1 = ipl;
    for (ipcc = 1; ipcc <= i__1; ++ipcc) {
	ipc = ipcc - ipl + 1;
	if (subres_ .ipt == 0) {
	    ipc = 0;
	}
	btc = 0.;
	bts = 0.;
	phy = 0.;
	dt = 0.;
	del = 0.;
	ns = 0;
	ik = 0;
	i__2 = ium;
	for (i__ = 1; i__ <= i__2; ++i__) {
	    dpr[i__ - 1] = 0.;
 
	}
	i__2 = ium;
	for (i__ = 1; i__ <= i__2; ++i__) {
	    for (j = 1; j <= 4; ++j) {
		t[i__ + j * 6 - 7] = 0.;
 
	    }
	}
	for (i__ = 1; i__ <= 2; ++i__) {
	    beta[i__ - 1] = 0.;
	    alfa[i__ - 1] = 0.;
	    phi[i__ - 1] = 0.;
	    phibf[i__ - 1] = 0.;
	    qw[i__ - 1] = 0.;
	    qwc[i__ - 1] = 0.;
	    clo0[i__ - 1] = 0.;
	    clop0[i__ - 1] = 0.;
	    ep[i__ - 1] = 0.;
 
	}
	qwc[2] = 0.;
	for (i__ = 1; i__ <= 10; ++i__) {
	    nnf[i__ - 1] = 0;
	    for (j = 1; j <= 18; ++j) {
		re[i__ + j * 10 - 11] = 0.;
		ip[i__ + j * 10 - 11] = 0;
 
	    }
	}
	for (i__ = 1; i__ <= 11; ++i__) {
	    aa[i__ - 1] = 0.;
	    bb[i__ - 1] = 0.;
	    cr[i__ - 1] = 0.;
	    ci[i__ - 1] = 0.;
 
	}
	for (i__ = 1; i__ <= 2; ++i__) {
	    for (j = 1; j <= 5; ++j) {
		dtu[i__ + (j << 1) - 3] = 0.;
 
	    }
	}
	for (i__ = 1; i__ <= 5; ++i__) {
	    for (j = 0; j <= 4; ++j) {
		for (k = 0; k <= 4; ++k) {
		    dtup[(i__ + (j + k * 5) * 5 << 1) - 2] = 0.;
		    dtup[(i__ + (j + k * 5) * 5 << 1) - 1] = 0.;
 
		}
	    }
	}
	for (i__ = 1; i__ <= 9; ++i__) {
	    nz2[i__ - 1] = 0;
	    for (j = 1; j <= 18; ++j) {
		chy[i__ + j * 9 - 10] = 0.;
		shy[i__ + j * 9 - 10] = 0.;
		for (k = 1; k <= 10; ++k) {
		    for (ii = 1; ii <= 10; ++ii) {
			e[k + ii * 10 - 11] = 0.;
			b[k + ii * 10 - 11] = 0.;
 
		    }
		    for (l = 1; l <= 5; ++l) {
			secom_ .rtc[i__ + (j + (k + l * 10) * 18) * 9 - 1792] 
				= 0.;
			secom_ .rts[i__ + (j + (k + l * 10) * 18) * 9 - 1792] 
				= 0.;
 
		    }
 
		}
 
	    }
 
	}
	s_wsfe(&io___3885);
	e_wsfe();
	s_wsfe(&io___3886);
	e_wsfe();
	pie = kons_ .pi * 2.;
	etl = 0.;
	radi = subres_ .totl / pie;
	nr = 0;
	dpr[0] = *dpp * 1e3;
	dpr[5] = 1e3;
	dpp1 = *dpp + clo_ .ded;
	clorb_(&dpp1);
	for (l = 1; l <= 2; ++l) {
	    clo0[l - 1] = (tra_._1) .clo[l - 1];
 
	    clop0[l - 1] = (tra_._1) .clop[l - 1];
	}
	clorb_(dpp);
	for (l = 1; l <= 2; ++l) {
	    beo_ .di0[l - 1] = (clo0[l - 1] - (tra_._1) .clo[l - 1]) / clo_ .ded;
 
	    beo_ .dip0[l - 1] = (clop0[l - 1] - (tra_._1) .clop[l - 1]) / 
		    clo_ .ded;
	}
	s_wsfe(&io___3892);
	e_wsfe();
	s_wsfe(&io___3893);
	for (l = 1; l <= 2; ++l) {
	    do_fio(&c__1, (char *)& beo_ .di0[l - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& beo_ .dip0[l - 1], (ftnlen)sizeof(
		    doublereal));
	}
	e_wsfe();
	betalf_(dpp, qw);
	phasad_(dpp, qwc);
	if (erro_ .ierro != 0) {
	    i__2 = erro_ .ierro + 22;
	    error_(&i__2);
	}
	s_wsfe(&io___3894);
	do_fio(&c__1, (char *)&(*dpp), (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&qwc[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&qwc[1], (ftnlen)sizeof(doublereal));
	e_wsfe();
	envar_(dpp);
 
	for (l = 1; l <= 2; ++l) {
	    ll = l << 1;
	    alfa[l - 1] = (tra_._1) .alf0[l - 1];
	    beta[l - 1] = (tra_._1) .bet0[l - 1];
	    t[(ll - 1) * 6 - 6] = (tra_._1) .clo[l - 1];
	    t[ll * 6 - 6] = (tra_._1) .clop[l - 1];
	    clo0[l - 1] = (tra_._1) .clo[l - 1];
 
	    clop0[l - 1] = (tra_._1) .clop[l - 1];
	}
	for (i__ = 1; i__ <= 4; ++i__) {
	    for (j = 1; j <= 4; ++j) {
		t[i__ + 1 + j * 6 - 7] = beo_ .ta[j + i__ * 6 - 7];
 
		t[i__ + 1 + j * 6 - 7] = beo_ .ta[j + i__ * 6 - 7];
	    }
	}
	s_wsfe(&io___3896);
	e_wsfe();
	s_wsfe(&io___3897);
	e_wsfe();
	s_wsfe(&io___3898);
	e_wsfe();
	s_wsfe(&io___3899);
	do_fio(&c__1, (char *)&nr, (ftnlen)sizeof(integer));
	do_fio(&c__1, "START   ", 8L);
	do_fio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	for (l = 1; l <= 2; ++l) {
	    do_fio(&c__1, (char *)&beta[l - 1], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&alfa[l - 1], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&phi[l - 1], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& beo_ .di0[l - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& beo_ .dip0[l - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)&clo0[l - 1], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&clop0[l - 1], (ftnlen)sizeof(doublereal));
	}
	e_wsfe();
 
	ep[0] = subres_ .tam1 * subres_ .tam1 / beta[0];
	ep[1] = subres_ .tam2 * subres_ .tam2 / beta[1];
	s_wsfe(&io___3900);
	do_fio(&c__1, (char *)& subres_ .tam1, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&ep[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)& subres_ .tam2, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&ep[1], (ftnlen)sizeof(doublereal));
	e_wsfe();
	s_wsfe(&io___3901);
	e_wsfe();
 
	izu = 0;
	i__2 = str_ .iu;
	for (k = 1; k <= i__2; ++k) {
	    for (k1 = 1; k1 <= 10; ++k1) {
		ab1[k1 - 1] = 0.;
 
		ab2[k1 - 1] = 0.;
	    }
	    ix = str_ .ic[k - 1];
	    if (ix > 300) {
		goto L250;
	    }
	    jj = 0;
	    dj = 1;
	    if (ix > 0) {
		goto L180;
	    }
	    ix = -ix;
	    jj = str2_ .mel[ix - 1] + 1;
	    dj = -1;
L180:
	    jm = str2_ .mel[ix - 1];
 
	    i__3 = jm;
	    for (j = 1; j <= i__3; ++j) {
		jj += dj;
		jk = str2_ .mtyp[ix + jj * 300 - 301];
		if (tit_ .ithick == 1 && ell_ .kz[jk - 1] != 0) {
		    goto L210;
		}
		if (tit_ .ithick == 0 && ell_ .kz[jk - 1] != 0) {
		    goto L790;
		}
 
		etl += ell_ .el[jk - 1];
		for (l = 1; l <= 2; ++l) {
		    ll = l << 1;
		    if ((d__1 = t[ll + (ll - 1) * 6 - 7], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) 
			    {
			phibf[l - 1] = atan(t[ll + 1 + (ll - 1) * 6 - 7] / t[
				ll + (ll - 1) * 6 - 7]);
		    } else {
			phibf[l - 1] = kons_ .pi2;
		    }
		    i__4 = ium;
		    for (i__ = 1; i__ <= i__4; ++i__) {
 
			t[i__ + (ll - 1) * 6 - 7] += t[i__ + ll * 6 - 7] * 
				ell_ .el[jk - 1];
		    }
		}
		for (l = 1; l <= 2; ++l) {
		    ll = l << 1;
		    beta[l - 1] = t[ll + (ll - 1) * 6 - 7] * t[ll + (ll - 1) *
			     6 - 7] + t[ll + 1 + (ll - 1) * 6 - 7] * t[ll + 1 
			    + (ll - 1) * 6 - 7];
		    alfa[l - 1] = -(t[ll + (ll - 1) * 6 - 7] * t[ll + ll * 6 
			    - 7] + t[ll + 1 + (ll - 1) * 6 - 7] * t[ll + 1 + 
			    ll * 6 - 7]);
		    clo0[l - 1] = t[(ll - 1) * 6 - 6];
		    clop0[l - 1] = t[ll * 6 - 6];
		    if ((d__1 = t[ll + (ll - 1) * 6 - 7], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) 
			    {
			dphi = atan(t[ll + 1 + (ll - 1) * 6 - 7] / t[ll + (ll 
				- 1) * 6 - 7]) - phibf[l - 1];
		    } else {
			dphi = kons_ .pi2 - phibf[l - 1];
		    }
		    if (-dphi > 1e-17) {
			dphi += kons_ .pi;
		    }
 
		    phi[l - 1] += dphi / pie;
		}
		++nr;
		goto L240;
 
L210:
		if (ell_ .kz[jk - 1] != 8) {
		    etl += ell_ .el[jk - 1];
		}
		for (l = 1; l <= 2; ++l) {
		    ll = l << 1;
		    if ((d__1 = t[ll + (ll - 1) * 6 - 7], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) 
			    {
			phibf[l - 1] = atan(t[ll + 1 + (ll - 1) * 6 - 7] / t[
				ll + (ll - 1) * 6 - 7]);
		    } else {
			phibf[l - 1] = 0.;
		    }
		    i__4 = ium;
		    for (i__ = 1; i__ <= i__4; ++i__) {
			puf = t[i__ + (ll - 1) * 6 - 7];
			t[i__ + (ll - 1) * 6 - 7] = puf * mat_ .a[jk + (l + 2)
				 * 700 - 2101] + t[i__ + ll * 6 - 7] * 
				mat_ .a[jk + (l + 4) * 700 - 2101] + dpr[i__ 
				- 1] * mat_ .a[jk + (l + 10) * 700 - 2101];
 
			t[i__ + ll * 6 - 7] = puf * mat_ .a[jk + (l + 6) * 
				700 - 2101] + t[i__ + ll * 6 - 7] * mat_ .a[
				jk + (l + 8) * 700 - 2101] + dpr[i__ - 1] * 
				mat_ .a[jk + (l + 12) * 700 - 2101];
		    }
		}
		for (l = 1; l <= 2; ++l) {
		    ll = l << 1;
		    beta[l - 1] = t[ll + (ll - 1) * 6 - 7] * t[ll + (ll - 1) *
			     6 - 7] + t[ll + 1 + (ll - 1) * 6 - 7] * t[ll + 1 
			    + (ll - 1) * 6 - 7];
		    alfa[l - 1] = -(t[ll + (ll - 1) * 6 - 7] * t[ll + ll * 6 
			    - 7] + t[ll + 1 + (ll - 1) * 6 - 7] * t[ll + 1 + 
			    ll * 6 - 7]);
		    clo0[l - 1] = t[(ll - 1) * 6 - 6];
		    clop0[l - 1] = t[ll * 6 - 6];
		    if ((d__1 = t[ll + (ll - 1) * 6 - 7], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) 
			    {
			dphi = atan(t[ll + 1 + (ll - 1) * 6 - 7] / t[ll + (ll 
				- 1) * 6 - 7]) - phibf[l - 1];
		    } else {
			dphi = -phibf[l - 1];
		    }
		    if (-dphi > 1e-17) {
			dphi += kons_ .pi;
		    }
 
		    phi[l - 1] += dphi / pie;
		}
		++nr;
L240:
		;
	    }
	    goto L790;
 
L250:
	    ix += -300;
	    qu = 0.;
	    qv = 0.;
	    kpz = ell_ .kp[ix - 1];
	    if (kpz == 6) {
		goto L790;
	    }
	    kzz = ell_ .kz[ix - 1];
	    if (kzz == 0) {
		goto L790;
	    }
	    dyy1 = 0.;
	    dyy2 = 0.;
	    if (rand0_ .iorg < 0) {
		rand0_ .mzu[k - 1] = izu;
	    }
	    izu = rand0_ .mzu[k - 1] + 1;
	    ekk = (ell_ .sm[ix - 1] + rand0_ .zfz[izu - 1] * ell_ .ek[ix - 1])
		     / (*dpp + 1.);
	    ++izu;
	    xs = pla_ .xpl[ix - 1] + rand0_ .zfz[izu - 1] * pla_ .xrms[ix - 1]
		    ;
	    ++izu;
	    zs = pla_ .zpl[ix - 1] + rand0_ .zfz[izu - 1] * pla_ .zrms[ix - 1]
		    ;
	    xl = (t[0] - xs) * rand1_ .tiltc[k - 1] + (t[12] - zs) * 
		    rand1_ .tilts[k - 1];
	    zl = -(t[0] - xs) * rand1_ .tilts[k - 1] + (t[12] - zs) * 
		    rand1_ .tiltc[k - 1];
	    crkve = xl;
	    cikve = zl;
	    if (kzz < 0) {
		goto L400;
	    }
	    switch ((int)kzz) {
		case 1:  goto L260;
		case 2:  goto L270;
		case 3:  goto L280;
		case 4:  goto L290;
		case 5:  goto L300;
		case 6:  goto L310;
		case 7:  goto L320;
		case 8:  goto L330;
		case 9:  goto L340;
		case 10:  goto L350;
		case 11:  goto L360;
	    }
	    goto L790;
 
L260:
	    ekk *= 1e3;
	    mpe = 20;
	    dyy1 = ekk * rand1_ .tiltc[k - 1];
	    dyy2 = ekk * rand1_ .tilts[k - 1];
	    qu = 0.;
	    qv = 0.;
	    goto L510;
 
L270:
	    dyy1 = ekk * (rand1_ .tiltc[k - 1] * xl + rand1_ .tilts[k - 1] * 
		    zl);
	    dyy2 = ekk * (- rand1_ .tiltc[k - 1] * zl + rand1_ .tilts[k - 1] * 
		    xl);
	    mpe = 20;
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    qu = ekk * tiltck;
	    qv = -ekk * tiltsk;
	    ab1[1] = qu;
	    ab2[1] = -qv;
	    goto L510;
 
L280:
	    ekk *= .001;
	    mpe = 3;
	    mx = 1;
	    cxzr = xl;
	    cxzi = zl;
	    cxzyr = cxzr * cxzr - cxzi * cxzi;
	    cxzyi = cxzr * cxzi + cxzi * cxzr;
	    dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] 
		    * cxzyi);
	    dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cxzyi + rand1_ .tilts[k - 1]
		     * cxzyr);
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    qu = ekk * 2. * (tiltck * xl + tiltsk * zl);
	    qv = ekk * 2. * (tiltck * zl - tiltsk * xl);
	    ab1[1] = qu;
	    ab2[1] = -qv;
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k 
		    - 1];
	    tiltck = tiltckuk;
	    ab1[2] = ekk * tiltck;
	    ab2[2] = ekk * tiltsk;
	    goto L510;
 
L290:
	    ekk *= 1e-6;
	    mpe = 4;
	    mx = 2;
	    cxzr = xl;
	    cxzi = zl;
	    cxzyr = cxzr * cxzr - cxzi * cxzi;
	    cxzyi = cxzr * cxzi + cxzi * cxzr;
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    qu = ekk * 3. * (tiltck * cxzyr + tiltsk * cxzyi);
	    qv = ekk * 3. * (tiltck * cxzyi - tiltsk * cxzyr);
	    ab1[1] = qu;
	    ab2[1] = -qv;
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] 
		    * cxzyi);
	    dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cxzyi + rand1_ .tilts[k - 1]
		     * cxzyr);
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k 
		    - 1];
	    tiltck = tiltckuk;
	    ab1[2] = ekk * 3. * (tiltck * xl + tiltsk * zl);
	    ab2[2] = ekk * 3. * (-tiltck * zl + tiltsk * xl);
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k 
		    - 1];
	    tiltck = tiltckuk;
	    ab1[3] = ekk * tiltck;
	    ab2[3] = ekk * tiltsk;
	    detune_(&c__2, &ekk, ep, beta, dtu, dtup, dfac);
	    goto L510;
 
L300:
	    ekk *= 1e-9;
	    mpe = 5;
	    mx = 3;
	    cxzr = xl;
	    cxzi = zl;
	    cxzyr = cxzr * cxzr - cxzi * cxzi;
	    cxzyi = cxzr * cxzi + cxzi * cxzr;
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk1 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[
		    k - 1];
	    tiltck1 = tiltckuk;
	    ab1[2] = ekk * 6 * (tiltck1 * cxzyr + tiltsk1 * cxzyi);
	    ab2[2] = ekk * 6 * (-tiltck1 * cxzyi + tiltsk1 * cxzyr);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    qu = ekk * 4. * (tiltck * cxzyr + tiltsk * cxzyi);
	    qv = ekk * 4. * (tiltck * cxzyi - tiltsk * cxzyr);
	    ab1[1] = qu;
	    ab2[1] = -qv;
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] 
		    * cxzyi);
	    dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cxzyi + rand1_ .tilts[k - 1]
		     * cxzyr);
	    tiltckuk = tiltck1 * rand1_ .tiltc[k - 1] - tiltsk1 * 
		    rand1_ .tilts[k - 1];
	    tiltsk = tiltck1 * rand1_ .tilts[k - 1] + tiltsk1 * rand1_ .tiltc[
		    k - 1];
	    tiltck = tiltckuk;
	    ab1[3] = ekk * 4. * (tiltck * xl + tiltsk * zl);
	    ab2[3] = ekk * 4. * (-tiltck * zl + tiltsk * xl);
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k 
		    - 1];
	    tiltck = tiltckuk;
	    ab1[4] = ekk * tiltck;
	    ab2[4] = ekk * tiltsk;
	    detune_(&c__2, &ab1[3], ep, beta, dtu, dtup, dfac);
	    goto L510;
 
L310:
	    ekk *= 1e-12;
	    mpe = 6;
	    mx = 4;
	    cxzr = xl;
	    cxzi = zl;
	    cxzyr = cxzr * cxzr - cxzi * cxzi;
	    cxzyi = cxzr * cxzi + cxzi * cxzr;
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk1 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[
		    k - 1];
	    tiltck1 = tiltckuk;
	    tiltckuk = tiltck1 * rand1_ .tiltc[k - 1] - tiltsk1 * 
		    rand1_ .tilts[k - 1];
	    tiltsk2 = tiltck1 * rand1_ .tilts[k - 1] + tiltsk1 * 
		    rand1_ .tiltc[k - 1];
	    tiltck2 = tiltckuk;
	    ab1[3] = ekk * 10 * (tiltck2 * cxzyr + tiltsk2 * cxzyi);
	    ab2[3] = ekk * 10 * (-tiltck2 * cxzyi + tiltsk2 * cxzyr);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    ab1[2] = ekk * 10 * (tiltck1 * cxzyr + tiltsk1 * cxzyi);
	    ab2[2] = ekk * 10 * (-tiltck1 * cxzyi + tiltsk1 * cxzyr);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    qu = ekk * 5 * (tiltck * cxzyr + tiltsk * cxzyi);
	    qv = ekk * 5 * (tiltck * cxzyi - tiltsk * cxzyr);
	    ab1[1] = qu;
	    ab2[1] = -qv;
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] 
		    * cxzyi);
	    dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cxzyi + rand1_ .tilts[k - 1]
		     * cxzyr);
	    tiltckuk = tiltck2 * rand1_ .tiltc[k - 1] - tiltsk2 * 
		    rand1_ .tilts[k - 1];
	    tiltsk = tiltck2 * rand1_ .tilts[k - 1] + tiltsk2 * rand1_ .tiltc[
		    k - 1];
	    tiltck = tiltckuk;
	    ab1[4] = ekk * 5 * (tiltck * xl + tiltsk * zl);
	    ab2[4] = ekk * 5 * (-tiltck * zl + tiltsk * xl);
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k 
		    - 1];
	    tiltck = tiltckuk;
	    ab1[5] = ekk * tiltck;
	    ab2[5] = ekk * tiltsk;
	    detune_(&c__2, &ab1[3], ep, beta, dtu, dtup, dfac);
	    detune_(&c__3, &ekk, ep, beta, dtu, dtup, dfac);
	    goto L510;
 
L320:
	    ekk *= 1e-15;
	    mpe = 7;
	    mx = 5;
	    cxzr = xl;
	    cxzi = zl;
	    cxzyr = cxzr * cxzr - cxzi * cxzi;
	    cxzyi = cxzr * cxzi + cxzi * cxzr;
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk1 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[
		    k - 1];
	    tiltck1 = tiltckuk;
	    tiltckuk = tiltck1 * rand1_ .tiltc[k - 1] - tiltsk1 * 
		    rand1_ .tilts[k - 1];
	    tiltsk2 = tiltck1 * rand1_ .tilts[k - 1] + tiltsk1 * 
		    rand1_ .tiltc[k - 1];
	    tiltck2 = tiltckuk;
	    tiltckuk = tiltck2 * rand1_ .tiltc[k - 1] - tiltsk2 * 
		    rand1_ .tilts[k - 1];
	    tiltsk3 = tiltck2 * rand1_ .tilts[k - 1] + tiltsk2 * 
		    rand1_ .tiltc[k - 1];
	    tiltck3 = tiltckuk;
	    ab1[4] = ekk * 15 * (tiltck3 * cxzyr + tiltsk3 * cxzyi);
	    ab2[4] = ekk * 15 * (-tiltck3 * cxzyi + tiltsk3 * cxzyr);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    ab1[3] = ekk * 20 * (tiltck2 * cxzyr + tiltsk2 * cxzyi);
	    ab2[3] = ekk * 20 * (-tiltck2 * cxzyi + tiltsk2 * cxzyr);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    ab1[4] = ekk * 15 * (tiltck1 * cxzyr + tiltsk1 * cxzyi);
	    ab2[4] = ekk * 15 * (-tiltck1 * cxzyi + tiltsk1 * cxzyr);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    qu = ekk * 6 * (tiltck * cxzyr + tiltsk * cxzyi);
	    qv = ekk * 6 * (tiltck * cxzyi - tiltsk * cxzyr);
	    ab1[1] = qu;
	    ab2[1] = -qv;
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] 
		    * cxzyi);
	    dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cxzyi + rand1_ .tilts[k - 1]
		     * cxzyr);
	    tiltckuk = tiltck3 * rand1_ .tiltc[k - 1] - tiltsk3 * 
		    rand1_ .tilts[k - 1];
	    tiltsk = tiltck3 * rand1_ .tilts[k - 1] + tiltsk3 * rand1_ .tiltc[
		    k - 1];
	    tiltck = tiltckuk;
	    ab1[5] = ekk * 6 * (tiltck * xl + tiltsk * zl);
	    ab2[5] = ekk * 6 * (-tiltck * zl + tiltsk * xl);
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k 
		    - 1];
	    tiltck = tiltckuk;
	    ab1[6] = ekk * tiltck;
	    ab2[6] = ekk * tiltsk;
	    detune_(&c__2, &ab1[3], ep, beta, dtu, dtup, dfac);
	    detune_(&c__3, &ab1[5], ep, beta, dtu, dtup, dfac);
	    goto L510;
 
L330:
	    ekk *= 1e-18;
	    mpe = 8;
	    mx = 6;
	    cxzr = xl;
	    cxzi = zl;
	    cxzyr = cxzr * cxzr - cxzi * cxzi;
	    cxzyi = cxzr * cxzi + cxzi * cxzr;
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk1 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[
		    k - 1];
	    tiltck1 = tiltckuk;
	    tiltckuk = tiltck1 * rand1_ .tiltc[k - 1] - tiltsk1 * 
		    rand1_ .tilts[k - 1];
	    tiltsk2 = tiltck1 * rand1_ .tilts[k - 1] + tiltsk1 * 
		    rand1_ .tiltc[k - 1];
	    tiltck2 = tiltckuk;
	    tiltckuk = tiltck2 * rand1_ .tiltc[k - 1] - tiltsk2 * 
		    rand1_ .tilts[k - 1];
	    tiltsk3 = tiltck2 * rand1_ .tilts[k - 1] + tiltsk2 * 
		    rand1_ .tiltc[k - 1];
	    tiltck3 = tiltckuk;
	    tiltckuk = tiltck3 * rand1_ .tiltc[k - 1] - tiltsk3 * 
		    rand1_ .tilts[k - 1];
	    tiltsk4 = tiltck3 * rand1_ .tilts[k - 1] + tiltsk3 * 
		    rand1_ .tiltc[k - 1];
	    tiltck4 = tiltckuk;
	    ab1[5] = ekk * 21 * (tiltck4 * cxzyr + tiltsk4 * cxzyi);
	    ab2[5] = ekk * 21 * (-tiltck4 * cxzyi + tiltsk4 * cxzyr);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    ab1[4] = ekk * 35 * (tiltck3 * cxzyr + tiltsk3 * cxzyi);
	    ab2[4] = ekk * 35 * (-tiltck3 * cxzyi + tiltsk3 * cxzyr);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    ab1[3] = ekk * 35 * (tiltck2 * cxzyr + tiltsk2 * cxzyi);
	    ab2[3] = ekk * 35 * (-tiltck2 * cxzyi + tiltsk2 * cxzyr);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    ab1[2] = ekk * 21 * (tiltck1 * cxzyr + tiltsk1 * cxzyi);
	    ab2[2] = ekk * 21 * (-tiltck1 * cxzyi + tiltsk1 * cxzyr);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    qu = ekk * 7 * (tiltck * cxzyr + tiltsk * cxzyi);
	    qv = ekk * 7 * (tiltck * cxzyi - tiltsk * cxzyr);
	    ab1[1] = qu;
	    ab2[1] = -qv;
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] 
		    * cxzyi);
	    dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cxzyi + rand1_ .tilts[k - 1]
		     * cxzyr);
	    tiltckuk = tiltck4 * rand1_ .tiltc[k - 1] - tiltsk4 * 
		    rand1_ .tilts[k - 1];
	    tiltsk = tiltck4 * rand1_ .tilts[k - 1] + tiltsk4 * rand1_ .tiltc[
		    k - 1];
	    tiltck = tiltckuk;
	    ab1[6] = ekk * 7 * (tiltck * xl + tiltsk * zl);
	    ab2[6] = ekk * 7 * (-tiltck * zl + tiltsk * xl);
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k 
		    - 1];
	    tiltck = tiltckuk;
	    ab1[7] = ekk * tiltck;
	    ab2[7] = ekk * tiltsk;
	    detune_(&c__2, &ab1[3], ep, beta, dtu, dtup, dfac);
	    detune_(&c__3, &ab1[5], ep, beta, dtu, dtup, dfac);
	    detune_(&c__4, &ekk, ep, beta, dtu, dtup, dfac);
	    goto L510;
 
L340:
	    ekk *= 1e-21;
	    mpe = 9;
	    mx = 7;
	    cxzr = xl;
	    cxzi = zl;
	    cxzyr = cxzr * cxzr - cxzi * cxzi;
	    cxzyi = cxzr * cxzi + cxzi * cxzr;
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk1 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[
		    k - 1];
	    tiltck1 = tiltckuk;
	    tiltckuk = tiltck1 * rand1_ .tiltc[k - 1] - tiltsk1 * 
		    rand1_ .tilts[k - 1];
	    tiltsk2 = tiltck1 * rand1_ .tilts[k - 1] + tiltsk1 * 
		    rand1_ .tiltc[k - 1];
	    tiltck2 = tiltckuk;
	    tiltckuk = tiltck2 * rand1_ .tiltc[k - 1] - tiltsk2 * 
		    rand1_ .tilts[k - 1];
	    tiltsk3 = tiltck2 * rand1_ .tilts[k - 1] + tiltsk2 * 
		    rand1_ .tiltc[k - 1];
	    tiltck3 = tiltckuk;
	    tiltckuk = tiltck3 * rand1_ .tiltc[k - 1] - tiltsk3 * 
		    rand1_ .tilts[k - 1];
	    tiltsk4 = tiltck3 * rand1_ .tilts[k - 1] + tiltsk3 * 
		    rand1_ .tiltc[k - 1];
	    tiltck4 = tiltckuk;
	    tiltckuk = tiltck4 * rand1_ .tiltc[k - 1] - tiltsk4 * 
		    rand1_ .tilts[k - 1];
	    tiltsk5 = tiltck4 * rand1_ .tilts[k - 1] + tiltsk4 * 
		    rand1_ .tiltc[k - 1];
	    tiltck5 = tiltckuk;
	    ab1[6] = ekk * 28 * (tiltck5 * cxzyr + tiltsk5 * cxzyi);
	    ab2[6] = ekk * 28 * (-tiltck5 * cxzyi + tiltsk5 * cxzyr);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    ab1[5] = ekk * 56 * (tiltck4 * cxzyr + tiltsk4 * cxzyi);
	    ab2[5] = ekk * 56 * (-tiltck4 * cxzyi + tiltsk4 * cxzyr);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    ab1[4] = ekk * 70 * (tiltck3 * cxzyr + tiltsk3 * cxzyi);
	    ab2[4] = ekk * 70 * (-tiltck3 * cxzyi + tiltsk3 * cxzyr);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    ab1[3] = ekk * 56 * (tiltck2 * cxzyr + tiltsk2 * cxzyi);
	    ab2[3] = ekk * 56 * (-tiltck2 * cxzyi + tiltsk2 * cxzyr);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    ab1[2] = ekk * 28 * (tiltck1 * cxzyr + tiltsk1 * cxzyi);
	    ab2[2] = ekk * 28 * (-tiltck1 * cxzyi + tiltsk1 * cxzyr);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    qu = ekk * 8 * (tiltck * cxzyr + tiltsk * cxzyi);
	    qv = ekk * 8 * (tiltck * cxzyi - tiltsk * cxzyr);
	    ab1[1] = qu;
	    ab2[1] = -qv;
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] 
		    * cxzyi);
	    dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cxzyi + rand1_ .tilts[k - 1]
		     * cxzyr);
	    tiltckuk = tiltck5 * rand1_ .tiltc[k - 1] - tiltsk5 * 
		    rand1_ .tilts[k - 1];
	    tiltsk = tiltck5 * rand1_ .tilts[k - 1] + tiltsk5 * rand1_ .tiltc[
		    k - 1];
	    tiltck = tiltckuk;
	    ab1[7] = ekk * 8 * (tiltck * xl + tiltsk * zl);
	    ab2[7] = ekk * 8 * (-tiltck * zl + tiltsk * xl);
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k 
		    - 1];
	    tiltck = tiltckuk;
	    ab1[8] = ekk * tiltck;
	    ab2[8] = ekk * tiltsk;
	    detune_(&c__2, &ab1[3], ep, beta, dtu, dtup, dfac);
	    detune_(&c__3, &ab1[5], ep, beta, dtu, dtup, dfac);
	    detune_(&c__4, &ab1[7], ep, beta, dtu, dtup, dfac);
	    goto L510;
 
L350:
	    ekk *= 1e-24;
	    mpe = 20;
	    cxzr = xl;
	    cxzi = zl;
	    cxzyr = cxzr * cxzr - cxzi * cxzi;
	    cxzyi = cxzr * cxzi + cxzi * cxzr;
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    qu = ekk * 9 * (tiltck * cxzyr + tiltsk * cxzyi);
	    qv = ekk * 9 * (tiltck * cxzyi - tiltsk * cxzyr);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] 
		    * cxzyi);
	    dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cxzyi + rand1_ .tilts[k - 1]
		     * cxzyr);
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k 
		    - 1];
	    tiltck = tiltckuk;
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk4 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[
		    k - 1];
	    tiltck4 = tiltckuk;
	    tiltckuk = tiltck4 * rand1_ .tiltc[k - 1] - tiltsk4 * 
		    rand1_ .tilts[k - 1];
	    tiltsk = tiltck4 * rand1_ .tilts[k - 1] + tiltsk4 * rand1_ .tiltc[
		    k - 1];
	    tiltck = tiltckuk;
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk6 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[
		    k - 1];
	    tiltck6 = tiltckuk;
	    tiltckuk = tiltck6 * rand1_ .tiltc[k - 1] - tiltsk6 * 
		    rand1_ .tilts[k - 1];
	    tiltsk = tiltck6 * rand1_ .tilts[k - 1] + tiltsk6 * rand1_ .tiltc[
		    k - 1];
	    tiltck = tiltckuk;
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk8 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[
		    k - 1];
	    tiltck8 = tiltckuk;
	    tiltckuk = tiltck8 * rand1_ .tiltc[k - 1] - tiltsk8 * 
		    rand1_ .tilts[k - 1];
	    tiltsk = tiltck8 * rand1_ .tilts[k - 1] + tiltsk8 * rand1_ .tiltc[
		    k - 1];
	    tiltck = tiltckuk;
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk10 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[
		    k - 1];
	    tiltck10 = tiltckuk;
	    ekko = ekk;
	    ekk = ekko * tiltck10;
	    detune_(&c__5, &ekk, ep, beta, dtu, dtup, dfac);
	    cxzyr = cxzr * cxzr - cxzi * cxzi;
	    cxzyi = cxzr * cxzi + cxzi * cxzr;
	    ekk = ekko * 36 * (tiltck8 * cxzyr + tiltsk8 * cxzyi);
	    detune_(&c__4, &ekk, ep, beta, dtu, dtup, dfac);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    ekk = ekko * 126 * (tiltck6 * cxzyr + tiltsk6 * cxzyi);
	    detune_(&c__3, &ekk, ep, beta, dtu, dtup, dfac);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    ekk = ekko * 84 * (tiltck4 * cxzyr + tiltsk4 * cxzyi);
	    detune_(&c__2, &ekk, ep, beta, dtu, dtup, dfac);
	    goto L510;
L360:
	    r0 = ell_ .ek[ix - 1];
	    if ((d__1 = dkic_ .dki[ix - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		if ((d__1 = dkic_ .dki[ix + 1399], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		    qu = - dkic_ .dki[ix - 1] / dkic_ .dki[ix + 1399] * 
			    dkic_ .dki[ix - 1] / (*dpp + 1.);
		    dppi = dkic_ .dki[ix - 1] * 1e3 / (*dpp + 1.);
		    t[6] = t[6] + (qu * xl - dppi * *dpp) * rand1_ .tiltc[k - 
			    1] + dppi * (1. - rand1_ .tiltc[k - 1]);
		    t[18] = t[18] + (qu * xl - dppi * *dpp) * rand1_ .tilts[k 
			    - 1] + dppi * rand1_ .tilts[k - 1];
		    i__3 = ium;
		    for (i__ = 2; i__ <= i__3; ++i__) {
			t[i__ + 5] += qu * t[i__ - 1] * rand1_ .tiltc[k - 1];
			t[i__ + 17] += qu * t[i__ + 11] * rand1_ .tilts[k - 1]
				;
 
		    }
		} else {
		    dppi = dkic_ .dki[ix - 1] * 1e3 / (*dpp + 1.);
		    t[6] = t[6] - dppi * *dpp * rand1_ .tiltc[k - 1] + dppi * 
			    (1. - rand1_ .tiltc[k - 1]);
		    t[18] = t[18] - dppi * *dpp * rand1_ .tilts[k - 1] + dppi 
			    * rand1_ .tilts[k - 1];
		}
	    }
	    if ((d__1 = dkic_ .dki[ix + 699], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		if ((d__1 = dkic_ .dki[ix + 1399], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		    qu = dkic_ .dki[ix + 699] / dkic_ .dki[ix + 1399] * 
			    dkic_ .dki[ix + 699] / (*dpp + 1.);
		    dppi = dkic_ .dki[ix + 699] * 1e3 / (*dpp + 1.);
		    t[6] = t[6] + (qu * zl - dppi * *dpp) * rand1_ .tilts[k - 
			    1] + dppi * rand1_ .tilts[k - 1];
		    t[18] = t[18] + (-qu * zl + dppi * *dpp) * rand1_ .tiltc[
			    k - 1] - dppi * (1. - rand1_ .tiltc[k - 1]);
		    i__3 = ium;
		    for (i__ = 2; i__ <= i__3; ++i__) {
			t[i__ + 5] += qu * t[i__ - 1] * rand1_ .tilts[k - 1];
			t[i__ + 17] -= qu * t[i__ + 11] * rand1_ .tiltc[k - 1]
				;
 
		    }
		} else {
		    dppi = dkic_ .dki[ix + 699] * 1e3 / (*dpp + 1.);
		    t[6] = t[6] - dppi * *dpp * rand1_ .tilts[k - 1] + dppi * 
			    rand1_ .tilts[k - 1];
		    t[18] = t[18] + dppi * *dpp * rand1_ .tiltc[k - 1] - dppi 
			    * (1. - rand1_ .tiltc[k - 1]);
		}
	    }
	    mpe = 9;
	    mx = 0;
	    if ((( r0 ) >= 0 ? ( r0 ) : -( r0 ))  <= 1e-17) {
		goto L790;
	    }
	    nmz = mult1_ .nmu[ix - 1];
	    if (nmz == 0) {
		izu += 22;
		goto L790;
	    }
	    im = mult1_ .irm[ix - 1];
	    r0a = 1.;
	    benkr = ell_ .ed[ix - 1] / (*dpp + 1.);
	    cr[0] = 1.;
	    cr[1] = xl;
	    ci[1] = zl;
	    cxzyr = xl;
	    cxzyi = zl;
	    cxzr = cxzyr;
	    cxzi = cxzyi;
	    dyy1 = 0.;
	    dyy2 = 0.;
	    qu = 0.;
	    qv = 0.;
	    lmin = 3;
	    if (nmz == 1) {
		lmin = 2;
	    }
	    for (l = lmin; l <= 11; ++l) {
		aa[l - 1] = 0.;
		bb[l - 1] = 0.;
		cr[l - 1] = 0.;
 
		ci[l - 1] = 0.;
	    }
	    i__3 = nmz;
	    for (l = 1; l <= i__3; ++l) {
		l1 = l - 1;
		++izu;
		aa[l - 1] = multi_ .ak0[im + l * 700 - 701] + rand0_ .zfz[izu 
			- 1] * multi_ .aka[im + l * 700 - 701];
		aa[l - 1] = benkr * aa[l - 1] / r0a;
		++izu;
		bb[l - 1] = multi_ .bk0[im + l * 700 - 701] + rand0_ .zfz[izu 
			- 1] * multi_ .bka[im + l * 700 - 701];
		bb[l - 1] = benkr * bb[l - 1] / r0a;
		r0a *= r0;
		if (l > 2) {
		    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
		    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
		    cxzyr = cxzyrr;
		    cr[l - 1] = cxzyr;
		    ci[l - 1] = cxzyi;
		}
		dyy1 = dyy1 + bb[l - 1] * cr[l - 1] + aa[l - 1] * ci[l - 1];
		dyy2 = dyy2 - bb[l - 1] * ci[l - 1] + aa[l - 1] * cr[l - 1];
		if (l > 1 && ium != 1) {
		    qu += l1 * (bb[l - 1] * cr[l1 - 1] + aa[l - 1] * ci[l1 - 
			    1]);
		    qv += l1 * (bb[l - 1] * ci[l1 - 1] - aa[l - 1] * cr[l1 - 
			    1]);
		}
 
	    }
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    qu1 = tiltck * qu - tiltsk * qv;
	    qv = tiltck * qv + tiltsk * qu;
	    qu = qu1;
	    dyy11 = rand1_ .tiltc[k - 1] * dyy1 - rand1_ .tilts[k - 1] * dyy2;
	    dyy2 = rand1_ .tiltc[k - 1] * dyy2 + rand1_ .tilts[k - 1] * dyy1;
	    dyy1 = dyy11;
	    izu = izu + 22 - (nmz << 1);
	    for (iv = 2; iv <= 5; ++iv) {
		tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
			rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
		tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
		tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * 
			rand1_ .tilts[k - 1];
		tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * 
			rand1_ .tiltc[k - 1];
		tiltck = tiltckuk;
		tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * 
			rand1_ .tilts[k - 1];
		tiltsk4 = tiltck * rand1_ .tilts[k - 1] + tiltsk * 
			rand1_ .tiltc[k - 1];
		tiltck4 = tiltckuk;
		tiltckuk = tiltck4 * rand1_ .tiltc[k - 1] - tiltsk4 * 
			rand1_ .tilts[k - 1];
		tiltsk = tiltck4 * rand1_ .tilts[k - 1] + tiltsk4 * 
			rand1_ .tiltc[k - 1];
		tiltck = tiltckuk;
		tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * 
			rand1_ .tilts[k - 1];
		tiltsk6 = tiltck * rand1_ .tilts[k - 1] + tiltsk * 
			rand1_ .tiltc[k - 1];
		tiltck6 = tiltckuk;
		tiltckuk = tiltck6 * rand1_ .tiltc[k - 1] - tiltsk6 * 
			rand1_ .tilts[k - 1];
		tiltsk = tiltck6 * rand1_ .tilts[k - 1] + tiltsk6 * 
			rand1_ .tiltc[k - 1];
		tiltck = tiltckuk;
		tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * 
			rand1_ .tilts[k - 1];
		tiltsk8 = tiltck * rand1_ .tilts[k - 1] + tiltsk * 
			rand1_ .tiltc[k - 1];
		tiltck8 = tiltckuk;
		tiltckuk = tiltck8 * rand1_ .tiltc[k - 1] - tiltsk8 * 
			rand1_ .tilts[k - 1];
		tiltsk = tiltck8 * rand1_ .tilts[k - 1] + tiltsk8 * 
			rand1_ .tiltc[k - 1];
		tiltck = tiltckuk;
		tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * 
			rand1_ .tilts[k - 1];
		tiltsk10 = tiltck * rand1_ .tilts[k - 1] + tiltsk * 
			rand1_ .tiltc[k - 1];
		tiltck10 = tiltckuk;
		if (iv == 2) {
		    ekk = tiltck4 * bb[3] + tiltsk4 * (-aa[3]) + tiltck4 * 4 *
			     (bb[4] * cr[1] + aa[4] * ci[1]) + tiltsk4 * 4 * (
			    bb[4] * ci[1] - aa[4] * cr[1]) + tiltck4 * 10 * (
			    bb[5] * cr[2] + aa[5] * ci[2]) + tiltsk4 * 10 * (
			    bb[5] * ci[2] - aa[5] * cr[2]) + tiltck4 * 20 * (
			    bb[6] * cr[3] + aa[6] * ci[3]) + tiltsk4 * 20 * (
			    bb[6] * ci[3] - aa[6] * cr[3]) + tiltck4 * 35 * (
			    bb[7] * cr[4] + aa[7] * ci[4]) + tiltsk4 * 35 * (
			    bb[7] * ci[4] - aa[7] * cr[4]) + tiltck4 * 56 * (
			    bb[8] * cr[5] + aa[8] * ci[5]) + tiltsk4 * 56 * (
			    bb[8] * ci[5] - aa[8] * cr[5]) + tiltck4 * 84 * (
			    bb[9] * cr[6] + aa[9] * ci[6]) + tiltsk4 * 84 * (
			    bb[9] * ci[6] - aa[9] * cr[6]);
		}
		if (iv == 3) {
		    ekk = tiltck6 * bb[5] + tiltsk6 * (-aa[5]) + tiltck6 * 6 *
			     (bb[6] * cr[1] + aa[6] * ci[1]) + tiltsk6 * 6 * (
			    bb[6] * ci[1] - aa[6] * cr[1]) + tiltck6 * 21 * (
			    bb[7] * cr[2] + aa[7] * ci[2]) + tiltsk6 * 21 * (
			    bb[7] * ci[2] - aa[7] * cr[2]) + tiltck6 * 56 * (
			    bb[8] * cr[3] + aa[8] * ci[3]) + tiltsk6 * 56 * (
			    bb[8] * ci[3] - aa[8] * cr[3]) + tiltck6 * 126 * (
			    bb[9] * cr[4] + aa[9] * ci[4]) + tiltsk6 * 126 * (
			    bb[9] * ci[4] - aa[9] * cr[4]);
		}
		if (iv == 4) {
		    ekk = tiltck8 * bb[7] + tiltsk8 * (-aa[7]) + tiltck8 * 8 *
			     (bb[8] * cr[1] + aa[8] * ci[1]) + tiltsk8 * 8 * (
			    bb[8] * ci[1] - aa[8] * cr[1]) + tiltck8 * 36 * (
			    bb[9] * cr[2] + aa[9] * ci[2]) + tiltsk8 * 36 * (
			    bb[9] * ci[2] - aa[9] * cr[2]);
		}
		if (iv == 5) {
		    ekk = tiltck10 * bb[9] - tiltsk10 * aa[9];
		}
		detune_(&iv, &ekk, ep, beta, dtu, dtup, dfac);
 
	    }
	    goto L510;
 
L400:
	    kzz = -kzz;
	    switch ((int)kzz) {
		case 1:  goto L410;
		case 2:  goto L420;
		case 3:  goto L430;
		case 4:  goto L440;
		case 5:  goto L450;
		case 6:  goto L460;
		case 7:  goto L470;
		case 8:  goto L480;
		case 9:  goto L490;
		case 10:  goto L500;
	    }
	    goto L790;
 
L410:
	    ekk *= 1e3;
	    mpe = 20;
	    dyy1 = -ekk * rand1_ .tilts[k - 1];
	    dyy2 = ekk * rand1_ .tiltc[k - 1];
	    qu = 0.;
	    qv = 0.;
	    goto L510;
 
L420:
	    dyy1 = ekk * (rand1_ .tiltc[k - 1] * zl - rand1_ .tilts[k - 1] * 
		    xl);
	    dyy2 = ekk * (rand1_ .tiltc[k - 1] * xl + rand1_ .tilts[k - 1] * 
		    zl);
	    mpe = 2;
	    mx = -1;
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    qu = -ekk * tiltsk;
	    qv = -ekk * tiltck;
	    ab1[1] = qu;
	    ab2[1] = -qv;
	    goto L510;
 
L430:
	    ekk *= .001;
	    mpe = 3;
	    mx = 1;
	    cxzr = xl;
	    cxzi = zl;
	    cxzyr = cxzr * cxzr - cxzi * cxzi;
	    cxzyi = cxzr * cxzi + cxzi * cxzr;
	    dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyi - rand1_ .tilts[k - 1] 
		    * cxzyr);
	    dyy2 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] 
		    * cxzyi);
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    qu = ekk * 2. * (tiltck * zl - tiltsk * xl);
	    qv = -ekk * 2. * (tiltck * xl + tiltsk * zl);
	    ab1[1] = qu;
	    ab2[1] = -qv;
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k 
		    - 1];
	    tiltck = tiltckuk;
	    ab1[2] = ekk * tiltsk;
	    ab2[2] = ekk * tiltck;
	    goto L510;
 
L440:
	    ekk *= 1e-6;
	    mpe = 4;
	    mx = 2;
	    cxzr = xl;
	    cxzi = zl;
	    cxzyr = cxzr * cxzr - cxzi * cxzi;
	    cxzyi = cxzr * cxzi + cxzi * cxzr;
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    qu = ekk * 3. * (tiltck * cxzyi - tiltsk * cxzyr);
	    qv = ekk * -3. * (tiltck * cxzyr + tiltsk * cxzyi);
	    ab1[1] = qu;
	    ab2[1] = -qv;
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyi - rand1_ .tilts[k - 1] 
		    * cxzyr);
	    dyy2 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] 
		    * cxzyi);
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k 
		    - 1];
	    tiltck = tiltckuk;
	    ab1[2] = ekk * 3. * (tiltck * zl - tiltsk * xl);
	    ab2[2] = ekk * 3. * (tiltck * xl + tiltsk * zl);
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k 
		    - 1];
	    tiltck = tiltckuk;
	    ab1[3] = ekk * tiltsk;
	    ab2[3] = ekk * tiltck;
	    goto L510;
 
L450:
	    ekk *= 1e-9;
	    mpe = 5;
	    mx = 3;
	    cxzr = xl;
	    cxzi = zl;
	    cxzyr = cxzr * cxzr - cxzi * cxzi;
	    cxzyi = cxzr * cxzi + cxzi * cxzr;
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk1 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[
		    k - 1];
	    tiltck1 = tiltckuk;
	    ab1[2] = ekk * 6 * (tiltck1 * cxzyi - tiltsk1 * cxzyr);
	    ab2[2] = ekk * 6 * (tiltck1 * cxzyr + tiltsk1 * cxzyi);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    qu = ekk * 4. * (tiltck * cxzyi - tiltsk * cxzyr);
	    qv = ekk * -4. * (tiltck * cxzyr + tiltsk * cxzyi);
	    ab1[1] = qu;
	    ab2[1] = -qv;
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyi - rand1_ .tilts[k - 1] 
		    * cxzyr);
	    dyy2 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] 
		    * cxzyi);
	    tiltckuk = tiltck1 * rand1_ .tiltc[k - 1] - tiltsk1 * 
		    rand1_ .tilts[k - 1];
	    tiltsk = tiltck1 * rand1_ .tilts[k - 1] + tiltsk1 * rand1_ .tiltc[
		    k - 1];
	    tiltck = tiltckuk;
	    ab1[3] = ekk * 4. * (tiltck * zl - tiltsk * xl);
	    ab2[3] = ekk * 4. * (tiltck * xl + tiltsk * zl);
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k 
		    - 1];
	    tiltck = tiltckuk;
	    ab1[4] = ekk * tiltsk;
	    ab2[4] = ekk * tiltck;
	    detune_(&c__2, &ab1[3], ep, beta, dtu, dtup, dfac);
	    goto L510;
 
L460:
	    ekk *= 1e-12;
	    mpe = 6;
	    mx = 4;
	    cxzr = xl;
	    cxzi = zl;
	    cxzyr = cxzr * cxzr - cxzi * cxzi;
	    cxzyi = cxzr * cxzi + cxzi * cxzr;
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk1 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[
		    k - 1];
	    tiltck1 = tiltckuk;
	    tiltckuk = tiltck1 * rand1_ .tiltc[k - 1] - tiltsk1 * 
		    rand1_ .tilts[k - 1];
	    tiltsk2 = tiltck1 * rand1_ .tilts[k - 1] + tiltsk1 * 
		    rand1_ .tiltc[k - 1];
	    tiltck2 = tiltckuk;
	    ab1[3] = ekk * 10 * (tiltck2 * cxzyi - tiltsk2 * cxzyr);
	    ab2[3] = ekk * 10 * (tiltck2 * cxzyr + tiltsk2 * cxzyi);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    ab1[2] = ekk * 10 * (tiltck1 * cxzyi - tiltsk1 * cxzyr);
	    ab2[2] = ekk * 10 * (tiltck1 * cxzyr + tiltsk1 * cxzyi);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    qu = ekk * 5 * (tiltck * cxzyi - tiltsk * cxzyr);
	    qv = ekk * -5 * (tiltck * cxzyr + tiltsk * cxzyi);
	    ab1[1] = qu;
	    ab2[1] = -qv;
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyi - rand1_ .tilts[k - 1] 
		    * cxzyr);
	    dyy2 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] 
		    * cxzyi);
	    tiltckuk = tiltck2 * rand1_ .tiltc[k - 1] - tiltsk2 * 
		    rand1_ .tilts[k - 1];
	    tiltsk = tiltck2 * rand1_ .tilts[k - 1] + tiltsk2 * rand1_ .tiltc[
		    k - 1];
	    tiltck = tiltckuk;
	    ab1[4] = ekk * 5 * (tiltck * zl - tiltsk * xl);
	    ab2[4] = ekk * 5 * (tiltck * xl + tiltsk * zl);
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k 
		    - 1];
	    tiltck = tiltckuk;
	    ab1[5] = ekk * tiltsk;
	    ab2[5] = ekk * tiltck;
	    detune_(&c__2, &ab1[3], ep, beta, dtu, dtup, dfac);
	    goto L510;
 
L470:
	    ekk *= 1e-15;
	    mpe = 7;
	    mx = 5;
	    cxzr = xl;
	    cxzi = zl;
	    cxzyr = cxzr * cxzr - cxzi * cxzi;
	    cxzyi = cxzr * cxzi + cxzi * cxzr;
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk1 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[
		    k - 1];
	    tiltck1 = tiltckuk;
	    tiltckuk = tiltck1 * rand1_ .tiltc[k - 1] - tiltsk1 * 
		    rand1_ .tilts[k - 1];
	    tiltsk2 = tiltck1 * rand1_ .tilts[k - 1] + tiltsk1 * 
		    rand1_ .tiltc[k - 1];
	    tiltck2 = tiltckuk;
	    tiltckuk = tiltck2 * rand1_ .tiltc[k - 1] - tiltsk2 * 
		    rand1_ .tilts[k - 1];
	    tiltsk3 = tiltck2 * rand1_ .tilts[k - 1] + tiltsk2 * 
		    rand1_ .tiltc[k - 1];
	    tiltck3 = tiltckuk;
	    ab1[4] = ekk * 15 * (tiltck3 * cxzyi - tiltsk3 * cxzyr);
	    ab2[4] = ekk * 15 * (tiltck3 * cxzyr + tiltsk3 * cxzyi);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    ab1[3] = ekk * 20 * (tiltck2 * cxzyi - tiltsk2 * cxzyr);
	    ab2[3] = ekk * 20 * (tiltck2 * cxzyr + tiltsk2 * cxzyi);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    ab1[2] = ekk * 15 * (tiltck1 * cxzyi - tiltsk1 * cxzyr);
	    ab2[2] = ekk * 15 * (tiltck1 * cxzyr + tiltsk1 * cxzyi);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    qu = ekk * 6 * (tiltck * cxzyi - tiltsk * cxzyr);
	    qv = ekk * -6 * (tiltck * cxzyr + tiltsk * cxzyi);
	    ab1[1] = qu;
	    ab2[1] = -qv;
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyi - rand1_ .tilts[k - 1] 
		    * cxzyr);
	    dyy2 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] 
		    * cxzyi);
	    tiltckuk = tiltck3 * rand1_ .tiltc[k - 1] - tiltsk3 * 
		    rand1_ .tilts[k - 1];
	    tiltsk = tiltck3 * rand1_ .tilts[k - 1] + tiltsk3 * rand1_ .tiltc[
		    k - 1];
	    tiltck = tiltckuk;
	    ab1[5] = ekk * 6 * (tiltck * zl - tiltsk * xl);
	    ab2[5] = ekk * 6 * (tiltck * xl + tiltsk * zl);
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k 
		    - 1];
	    tiltck = tiltckuk;
	    ab1[6] = ekk * tiltsk;
	    ab2[6] = ekk * tiltck;
	    detune_(&c__2, &ab1[3], ep, beta, dtu, dtup, dfac);
	    detune_(&c__3, &ab1[5], ep, beta, dtu, dtup, dfac);
	    goto L510;
 
L480:
	    ekk *= 1e-18;
	    mpe = 8;
	    mx = 6;
	    cxzr = xl;
	    cxzi = zl;
	    cxzyr = cxzr * cxzr - cxzi * cxzi;
	    cxzyi = cxzr * cxzi + cxzi * cxzr;
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk1 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[
		    k - 1];
	    tiltck1 = tiltckuk;
	    tiltckuk = tiltck1 * rand1_ .tiltc[k - 1] - tiltsk1 * 
		    rand1_ .tilts[k - 1];
	    tiltsk2 = tiltck1 * rand1_ .tilts[k - 1] + tiltsk1 * 
		    rand1_ .tiltc[k - 1];
	    tiltck2 = tiltckuk;
	    tiltckuk = tiltck2 * rand1_ .tiltc[k - 1] - tiltsk2 * 
		    rand1_ .tilts[k - 1];
	    tiltsk3 = tiltck2 * rand1_ .tilts[k - 1] + tiltsk2 * 
		    rand1_ .tiltc[k - 1];
	    tiltck3 = tiltckuk;
	    tiltckuk = tiltck3 * rand1_ .tiltc[k - 1] - tiltsk3 * 
		    rand1_ .tilts[k - 1];
	    tiltsk4 = tiltck3 * rand1_ .tilts[k - 1] + tiltsk3 * 
		    rand1_ .tiltc[k - 1];
	    tiltck4 = tiltckuk;
	    ab1[5] = ekk * 21 * (tiltck4 * cxzyi - tiltsk4 * cxzyr);
	    ab2[5] = ekk * 21 * (tiltck4 * cxzyr + tiltsk4 * cxzyi);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    ab1[4] = ekk * 35 * (tiltck3 * cxzyi - tiltsk3 * cxzyr);
	    ab2[4] = ekk * 35 * (tiltck3 * cxzyr + tiltsk3 * cxzyi);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    ab1[3] = ekk * 35 * (tiltck2 * cxzyi - tiltsk2 * cxzyr);
	    ab2[3] = ekk * 35 * (tiltck2 * cxzyr + tiltsk2 * cxzyi);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    ab1[2] = ekk * 21 * (tiltck1 * cxzyi - tiltsk1 * cxzyr);
	    ab2[2] = ekk * 21 * (tiltck1 * cxzyr + tiltsk1 * cxzyi);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    qu = ekk * 7 * (tiltck * cxzyi - tiltsk * cxzyr);
	    qv = ekk * -7 * (tiltck * cxzyr + tiltsk * cxzyi);
	    ab1[1] = qu;
	    ab2[1] = -qv;
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyi - rand1_ .tilts[k - 1] 
		    * cxzyr);
	    dyy2 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] 
		    * cxzyi);
	    tiltckuk = tiltck4 * rand1_ .tiltc[k - 1] - tiltsk4 * 
		    rand1_ .tilts[k - 1];
	    tiltsk = tiltck4 * rand1_ .tilts[k - 1] + tiltsk4 * rand1_ .tiltc[
		    k - 1];
	    tiltck = tiltckuk;
	    ab1[6] = ekk * 7 * (tiltck * zl - tiltsk * xl);
	    ab2[6] = ekk * 7 * (tiltck * xl + tiltsk * zl);
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k 
		    - 1];
	    tiltck = tiltckuk;
	    ab1[7] = ekk * tiltsk;
	    ab2[7] = ekk * tiltck;
	    detune_(&c__2, &ab1[3], ep, beta, dtu, dtup, dfac);
	    detune_(&c__3, &ab1[5], ep, beta, dtu, dtup, dfac);
	    goto L510;
 
L490:
	    ekk *= 1e-21;
	    mpe = 9;
	    mx = 7;
	    cxzr = xl;
	    cxzi = zl;
	    cxzyr = cxzr * cxzr - cxzi * cxzi;
	    cxzyi = cxzr * cxzi + cxzi * cxzr;
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk1 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[
		    k - 1];
	    tiltck1 = tiltckuk;
	    tiltckuk = tiltck1 * rand1_ .tiltc[k - 1] - tiltsk1 * 
		    rand1_ .tilts[k - 1];
	    tiltsk2 = tiltck1 * rand1_ .tilts[k - 1] + tiltsk1 * 
		    rand1_ .tiltc[k - 1];
	    tiltck2 = tiltckuk;
	    tiltckuk = tiltck2 * rand1_ .tiltc[k - 1] - tiltsk2 * 
		    rand1_ .tilts[k - 1];
	    tiltsk3 = tiltck2 * rand1_ .tilts[k - 1] + tiltsk2 * 
		    rand1_ .tiltc[k - 1];
	    tiltck3 = tiltckuk;
	    tiltckuk = tiltck3 * rand1_ .tiltc[k - 1] - tiltsk3 * 
		    rand1_ .tilts[k - 1];
	    tiltsk4 = tiltck3 * rand1_ .tilts[k - 1] + tiltsk3 * 
		    rand1_ .tiltc[k - 1];
	    tiltck4 = tiltckuk;
	    tiltckuk = tiltck4 * rand1_ .tiltc[k - 1] - tiltsk4 * 
		    rand1_ .tilts[k - 1];
	    tiltsk5 = tiltck4 * rand1_ .tilts[k - 1] + tiltsk4 * 
		    rand1_ .tiltc[k - 1];
	    tiltck5 = tiltckuk;
	    ab1[6] = ekk * 28 * (tiltck5 * cxzyi - tiltsk5 * cxzyr);
	    ab2[6] = ekk * 28 * (tiltck5 * cxzyr + tiltsk5 * cxzyi);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    ab1[5] = ekk * 56 * (tiltck4 * cxzyi - tiltsk4 * cxzyr);
	    ab2[5] = ekk * 56 * (tiltck4 * cxzyr + tiltsk4 * cxzyi);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    ab1[4] = ekk * 70 * (tiltck3 * cxzyi - tiltsk3 * cxzyr);
	    ab2[4] = ekk * 70 * (tiltck3 * cxzyr + tiltsk3 * cxzyi);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    ab1[3] = ekk * 56 * (tiltck2 * cxzyi - tiltsk2 * cxzyr);
	    ab2[3] = ekk * 56 * (tiltck2 * cxzyr + tiltsk2 * cxzyi);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    ab1[2] = ekk * 28 * (tiltck1 * cxzyi - tiltsk1 * cxzyr);
	    ab2[2] = ekk * 28 * (tiltck1 * cxzyr + tiltsk1 * cxzyi);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    qu = ekk * 8 * (tiltck * cxzyi - tiltsk * cxzyr);
	    qv = ekk * -8 * (tiltck * cxzyr + tiltsk * cxzyi);
	    ab1[1] = qu;
	    ab2[1] = -qv;
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyi - rand1_ .tilts[k - 1] 
		    * cxzyr);
	    dyy2 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] 
		    * cxzyi);
	    tiltckuk = tiltck5 * rand1_ .tiltc[k - 1] - tiltsk5 * 
		    rand1_ .tilts[k - 1];
	    tiltsk = tiltck5 * rand1_ .tilts[k - 1] + tiltsk5 * rand1_ .tiltc[
		    k - 1];
	    tiltck = tiltckuk;
	    ab1[7] = ekk * 8 * (tiltck * zl - tiltsk * xl);
	    ab2[7] = ekk * 8 * (tiltck * xl + tiltsk * zl);
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k 
		    - 1];
	    tiltck = tiltckuk;
	    ab1[8] = ekk * tiltsk;
	    ab2[8] = ekk * tiltck;
	    detune_(&c__2, &ab1[3], ep, beta, dtu, dtup, dfac);
	    detune_(&c__3, &ab1[5], ep, beta, dtu, dtup, dfac);
	    detune_(&c__4, &ab1[7], ep, beta, dtu, dtup, dfac);
	    goto L510;
 
L500:
	    ekk *= 1e-24;
	    mpe = 20;
	    cxzr = xl;
	    cxzi = zl;
	    cxzyr = cxzr * cxzr - cxzi * cxzi;
	    cxzyi = cxzr * cxzi + cxzi * cxzr;
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    qu = ekk * 9 * (tiltck * cxzyi - tiltsk * cxzyr);
	    qv = ekk * -9 * (tiltck * cxzyr + tiltsk * cxzyi);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyi - rand1_ .tilts[k - 1] 
		    * cxzyr);
	    dyy2 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] 
		    * cxzyi);
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k 
		    - 1];
	    tiltck = tiltckuk;
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk4 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[
		    k - 1];
	    tiltck4 = tiltckuk;
	    tiltckuk = tiltck4 * rand1_ .tiltc[k - 1] - tiltsk4 * 
		    rand1_ .tilts[k - 1];
	    tiltsk = tiltck4 * rand1_ .tilts[k - 1] + tiltsk4 * rand1_ .tiltc[
		    k - 1];
	    tiltck = tiltckuk;
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk6 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[
		    k - 1];
	    tiltck6 = tiltckuk;
	    tiltckuk = tiltck6 * rand1_ .tiltc[k - 1] - tiltsk6 * 
		    rand1_ .tilts[k - 1];
	    tiltsk = tiltck6 * rand1_ .tilts[k - 1] + tiltsk6 * rand1_ .tiltc[
		    k - 1];
	    tiltck = tiltckuk;
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk8 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[
		    k - 1];
	    tiltck8 = tiltckuk;
	    tiltckuk = tiltck8 * rand1_ .tiltc[k - 1] - tiltsk8 * 
		    rand1_ .tilts[k - 1];
	    tiltsk = tiltck8 * rand1_ .tilts[k - 1] + tiltsk8 * rand1_ .tiltc[
		    k - 1];
	    tiltck = tiltckuk;
	    tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[
		    k - 1];
	    tiltsk10 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[
		    k - 1];
	    tiltck10 = tiltckuk;
	    ekko = ekk;
	    ekk = -ekko * tiltsk10;
	    detune_(&c__5, &ekk, ep, beta, dtu, dtup, dfac);
	    cxzyr = cxzr * cxzr - cxzi * cxzi;
	    cxzyi = cxzr * cxzi + cxzi * cxzr;
	    ekk = ekko * 36 * (tiltck8 * cxzyi - tiltsk8 * cxzyr);
	    detune_(&c__4, &ekk, ep, beta, dtu, dtup, dfac);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    ekk = ekko * 126 * (tiltck6 * cxzyi - tiltsk6 * cxzyr);
	    detune_(&c__3, &ekk, ep, beta, dtu, dtup, dfac);
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	    cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	    cxzyr = cxzyrr;
	    ekk = ekko * 84 * (tiltck4 * cxzyi - tiltsk4 * cxzyr);
	    detune_(&c__2, &ekk, ep, beta, dtu, dtup, dfac);
L510:
	    t[6] += dyy1;
	    t[18] += dyy2;
	    i__3 = ium;
	    for (i__ = 2; i__ <= i__3; ++i__) {
		t[i__ + 5] = t[i__ + 5] + qu * t[i__ - 1] - qv * t[i__ + 11];
		t[i__ + 17] = t[i__ + 17] - qu * t[i__ + 11] - qv * t[i__ - 1]
			;
 
	    }
	    for (l = 1; l <= 2; ++l) {
		ll = l << 1;
		alfa[l - 1] = -(t[ll + (ll - 1) * 6 - 7] * t[ll + ll * 6 - 7] 
			+ t[ll + 1 + (ll - 1) * 6 - 7] * t[ll + 1 + ll * 6 - 
			7]);
 
		clop0[l - 1] = t[ll * 6 - 6];
	    }
	    if (mpe > 9 || mpe == 9 && nmz <= 1) {
		goto L790;
	    }
	    if (mpe < subres_ .nta) {
		goto L790;
	    }
	    if (mpe > subres_ .nte) {
		mpe = subres_ .nte;
	    }
	    if (subres_ .nta > 2) {
		goto L550;
	    }
	    if (mx == -1 || mx == 1 || mx == 2 || mx == 3 || mx == 4 || mx == 
		    5 || mx == 6 || mx == 7) {
		goto L550;
	    }
 

 
 

	    i__3 = nmz;
	    for (l = 2; l <= i__3; ++l) {
		l1 = l - 1;
 
		ab2[1] += l1 * (aa[l - 1] * cr[l1 - 1] - bb[l - 1] * ci[l1 - 
			1]);
	    }
L550:
	    b1 = beta[0];
	    b2 = beta[1];
	    sb1 = sqrt(b1);
	    sb2 = sqrt(b2);
	    b[2] = b1;
	    b[20] = b2;
	    b[11] = sb1 * sb2;
	    if (subres_ .nta > 3) {
		goto L570;
	    }
	    if (mpe == 2 || mpe == 9 && nmz <= 2) {
		goto L700;
	    }
	    if (mx == 1 || mx == 2 || mx == 3 || mx == 4 || mx == 5 || mx == 
		    6 || mx == 7) {
		goto L570;
	    }
 

 
 

	    l2 = 1;
	    i__3 = nmz;
	    for (l = 3; l <= i__3; ++l) {
		l1 = l - 2;
		ab1[2] += l2 * (aa[l - 1] * ci[l1 - 1] + bb[l - 1] * cr[l1 - 
			1]);
		ab2[2] += l2 * (aa[l - 1] * cr[l1 - 1] - bb[l - 1] * ci[l1 - 
			1]);
 
		l2 = l2 * l / l1;
	    }
L570:
	    b[3] = b1 * sb1;
	    b[30] = b2 * sb2;
	    b[12] = b1 * sb2;
	    b[21] = b2 * sb1;
	    if (subres_ .nta > 4) {
		goto L590;
	    }
	    if (mpe == 3 || mpe == 9 && nmz <= 3) {
		goto L700;
	    }
	    if (mx == 2 || mx == 3 || mx == 4 || mx == 5 || mx == 6 || mx == 
		    7) {
		goto L590;
	    }
 

 
 

	    l2 = 1;
	    i__3 = nmz;
	    for (l = 4; l <= i__3; ++l) {
		l1 = l - 3;
		ab1[3] += l2 * (aa[l - 1] * ci[l1 - 1] + bb[l - 1] * cr[l1 - 
			1]);
		ab2[3] += l2 * (aa[l - 1] * cr[l1 - 1] - bb[l - 1] * ci[l1 - 
			1]);
 
		l2 = l2 * l / l1;
	    }
L590:
	    b[4] = b1 * b1;
	    b[40] = b2 * b2;
	    b[13] = b[12] * sb1;
	    b[31] = b[21] * sb2;
	    b[22] = b1 * b2;
	    if (subres_ .nta > 5) {
		goto L610;
	    }
	    if (mpe == 4 || mpe == 9 && nmz <= 4) {
		goto L700;
	    }
	    if (mx == 3 || mx == 4 || mx == 5 || mx == 6 || mx == 7) {
		goto L610;
	    }
 

 
 

	    l2 = 1;
	    i__3 = nmz;
	    for (l = 5; l <= i__3; ++l) {
		l1 = l - 4;
		ab1[4] += l2 * (aa[l - 1] * ci[l1 - 1] + bb[l - 1] * cr[l1 - 
			1]);
		ab2[4] += l2 * (aa[l - 1] * cr[l1 - 1] - bb[l - 1] * ci[l1 - 
			1]);
 
		l2 = l2 * l / l1;
	    }
L610:
	    b[5] = b[4] * sb1;
	    b[50] = b[40] * sb2;
	    b[14] = b[13] * sb1;
	    b[41] = b[31] * sb2;
	    b[23] = b[13] * sb2;
	    b[32] = b[31] * sb1;
	    if (subres_ .nta > 6) {
		goto L630;
	    }
	    if (mpe == 5 || mpe == 9 && nmz <= 5) {
		goto L700;
	    }
	    if (mx == 4 || mx == 5 || mx == 6 || mx == 7) {
		goto L630;
	    }
 

 
 

	    l2 = 1;
	    i__3 = nmz;
	    for (l = 6; l <= i__3; ++l) {
		l1 = l - 5;
		ab1[5] += l2 * (aa[l - 1] * ci[l1 - 1] + bb[l - 1] * cr[l1 - 
			1]);
		ab2[5] += l2 * (aa[l - 1] * cr[l1 - 1] - bb[l - 1] * ci[l1 - 
			1]);
 
		l2 = l2 * l / l1;
	    }
L630:
	    b[6] = b[5] * sb1;
	    b[60] = b[50] * sb2;
	    b[15] = b[14] * sb1;
	    b[51] = b[41] * sb2;
	    b[24] = b[14] * sb2;
	    b[42] = b[41] * sb1;
	    b[33] = b[32] * sb1;
	    if (subres_ .nta > 7) {
		goto L650;
	    }
	    if (mpe == 6 || mpe == 9 && nmz <= 6) {
		goto L700;
	    }
	    if (mx == 5 || mx == 6 || mx == 7) {
		goto L650;
	    }
 

 
 

	    l2 = 1;
	    i__3 = nmz;
	    for (l = 7; l <= i__3; ++l) {
		l1 = l - 6;
		ab1[6] += l2 * (aa[l - 1] * ci[l1 - 1] + bb[l - 1] * cr[l1 - 
			1]);
		ab2[6] += l2 * (aa[l - 1] * cr[l1 - 1] - bb[l - 1] * ci[l1 - 
			1]);
 
		l2 = l2 * l / l1;
	    }
L650:
	    b[7] = b[6] * sb1;
	    b[70] = b[60] * sb2;
	    b[16] = b[6] * sb2;
	    b[61] = b[60] * sb1;
	    b[25] = b[24] * sb1;
	    b[52] = b[42] * sb2;
	    b[34] = b[33] * sb1;
	    b[43] = b[33] * sb2;
	    if (subres_ .nta > 8) {
		goto L670;
	    }
	    if (mpe == 7 || mpe == 9 && nmz <= 7) {
		goto L700;
	    }
	    if (mx == 6 || mx == 7) {
		goto L670;
	    }
 

 
 

	    l2 = 1;
	    i__3 = nmz;
	    for (l = 8; l <= i__3; ++l) {
		l1 = l - 7;
		ab1[7] += l2 * (aa[l - 1] * ci[l1 - 1] + bb[l - 1] * cr[l1 - 
			1]);
		ab2[7] += l2 * (aa[l - 1] * cr[l1 - 1] - bb[l - 1] * ci[l1 - 
			1]);
 
		l2 = l2 * l / l1;
	    }
L670:
	    b[8] = b[7] * sb1;
	    b[80] = b[70] * sb2;
	    b[17] = b[7] * sb2;
	    b[71] = b[70] * sb1;
	    b[26] = b[16] * sb2;
	    b[62] = b[61] * sb1;
	    b[35] = b[25] * sb2;
	    b[53] = b[52] * sb1;
	    b[44] = b[43] * sb1;
	    if (mpe == 8 || mpe == 9 && nmz <= 8) {
		goto L700;
	    }
	    if (mx == 7) {
		goto L690;
	    }
 

 
 

	    l2 = 1;
	    i__3 = nmz;
	    for (l = 9; l <= i__3; ++l) {
		l1 = l - 8;
		ab1[8] += l2 * (aa[l - 1] * ci[l1 - 1] + bb[l - 1] * cr[l1 - 
			1]);
		ab2[8] += l2 * (aa[l - 1] * cr[l1 - 1] - bb[l - 1] * ci[l1 - 
			1]);
 
		l2 = l2 * l / l1;
	    }
L690:
	    b[9] = b[8] * sb1;
	    b[90] = b[80] * sb2;
	    b[18] = b[8] * sb2;
	    b[81] = b[80] * sb1;
	    b[27] = b[17] * sb2;
	    b[72] = b[71] * sb1;
	    b[63] = b[62] * sb1;
	    b[36] = b[26] * sb2;
	    b[54] = b[53] * sb1;
	    b[45] = b[35] * sb2;
 

L700:
	    i__3 = mpe;
	    for (np = 1; np <= i__3; ++np) {
		n2e = np << 1;
		i__4 = n2e;
		for (nv = 1; nv <= i__4; ++nv) {
		    n2 = nv - np;
		    nn2 = (( n2 ) >= 0 ? ( n2 ) : -( n2 )) ;
		    nn1 = np - nn2;
		    re1 = nn1 * subres_ .qxt + n2 * subres_ .qzt;
		    ip[np + nv * 10 - 11] = (integer) (re1 + .5) + ipc;
		    if (-re1 > 1e-17) {
			ip[np + nv * 10 - 11] = -((integer) ((( re1 ) >= 0 ? ( re1 ) : -( re1 ))  + .5)) 
				- ipc;
		    }
 
		    re[np + nv * 10 - 11] = re1 - ip[np + nv * 10 - 11];
		    res = re[np + nv * 10 - 11] / radi;
		    chy[np + nv * 9 - 10] = cos(nn1 * pie * phi[0] + n2 * pie 
			    * phi[1] - res * etl);
		    shy[np + nv * 9 - 10] = sin(nn1 * pie * phi[0] + n2 * pie 
			    * phi[1] - res * etl);
 
		}
 
	    }
	    i__3 = mpe;
	    for (np = subres_ .nta; np <= i__3; ++np) {
		np2 = np;
		nkk = 0;
L730:
		++nkk;
		n2e = np2 << 1;
		i__4 = nkk;
		for (i__ = 1; i__ <= i__4; ++i__) {
		    i__5 = n2e;
		    for (nv = 1; nv <= i__5; ++nv) {
			nn2 = (i__6 = nv - np2, (( i__6 ) >= 0 ? ( i__6 ) : -( i__6 )) );
			nv1 = np2 - nn2 + (i__ - 1 << 1) + 1;
			nv2 = np - nv1 + 2;
			rn2 = nn2 * .5;
 
			mm = 0;
			gerad = rn2 - d_int(&rn2);
			if ((( gerad ) >= 0 ? ( gerad ) : -( gerad ))  <= 1e-17) {
			    mm = 1;
			}
 
			if (mm == 0) {
			    goto L740;
			}
			btc = ab1[np - 1] * b[nv1 + nv2 * 10 - 11] * chy[np2 
				+ nv * 9 - 10];
			bts = ab1[np - 1] * b[nv1 + nv2 * 10 - 11] * shy[np2 
				+ nv * 9 - 10];
			goto L750;
L740:
			btc = ab2[np - 1] * b[nv1 + nv2 * 10 - 11] * chy[np2 
				+ nv * 9 - 10];
			bts = ab2[np - 1] * b[nv1 + nv2 * 10 - 11] * shy[np2 
				+ nv * 9 - 10];
L750:
			secom_ .rtc[np2 + (nv + (np + i__ * 10) * 18) * 9 - 
				1792] += btc;
			secom_ .rts[np2 + (nv + (np + i__ * 10) * 18) * 9 - 
				1792] += bts;
 
		    }
 
		}
		np2 += -2;
		if (np2 >= 1) {
		    goto L730;
		}
 
	    }
	    ++nr;
L790:
	    ;
	}
	nnf[0] = 1;
	nnf[1] = 1;
	nnf[2] = 2;
	nz2[1] = 2;
	sea = sqrt(ep[0]);
	seb = sqrt(ep[1]);
	ea = ep[0];
	eb = ep[1];
	e[2] = 1. / eb;
	e[20] = 1. / ea;
	e[11] = 1. / seb / sea;
	nnf[3] = 6;
	nz2[2] = 4;
	e[3] = sea / eb;
	e[30] = seb / ea;
	e[12] = 1. / seb;
	e[21] = 1. / sea;
	nnf[4] = 24;
	nz2[3] = 8;
	e[4] = ea / eb;
	e[40] = eb / ea;
	e[13] = sea / seb;
	e[31] = seb / sea;
	e[22] = 1.;
	nnf[5] = 120;
	nz2[4] = 16;
	e[5] = e[4] * sea;
	e[50] = e[40] * seb;
	e[14] = ea / seb;
	e[41] = eb / sea;
	e[23] = sea;
	e[32] = seb;
	nnf[6] = 720;
	nz2[5] = 32;
	e[6] = e[5] * sea;
	e[60] = e[50] * seb;
	e[15] = e[14] * sea;
	e[51] = e[41] * seb;
	e[24] = ea;
	e[42] = eb;
	e[33] = sea * seb;
	nnf[7] = 5040;
	nz2[6] = 64;
	e[7] = e[6] * sea;
	e[70] = e[60] * seb;
	e[16] = e[15] * sea;
	e[61] = e[51] * seb;
	e[25] = ea * sea;
	e[52] = eb * seb;
	e[34] = ea * seb;
	e[43] = sea * eb;
	nnf[8] = 40320;
	nz2[7] = 128;
	e[8] = e[7] * sea;
	e[80] = e[70] * seb;
	e[17] = e[16] * sea;
	e[71] = e[61] * seb;
	e[26] = ea * ea;
	e[62] = eb * eb;
	e[35] = e[34] * sea;
	e[53] = e[43] * seb;
	e[44] = ea * eb;
	nnf[9] = 362880;
	nz2[8] = 256;
	e[9] = e[8] * sea;
	e[90] = e[80] * seb;
	e[18] = e[17] * sea;
	e[81] = e[71] * seb;
	e[27] = e[26] * sea;
	e[72] = e[62] * seb;
	e[36] = e[35] * sea;
	e[63] = e[53] * seb;
	e[45] = e[44] * sea;
	e[54] = e[44] * seb;
	s_wsfe(&io___3988);
	e_wsfe();
	s_wsfe(&io___3989);
	e_wsfe();
	s_wsfe(&io___3990);
	do_fio(&c__1, (char *)&nr, (ftnlen)sizeof(integer));
	do_fio(&c__1, "END     ", 8L);
	do_fio(&c__1, (char *)&etl, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&c_b251, (ftnlen)sizeof(doublereal));
	for (l = 1; l <= 2; ++l) {
	    do_fio(&c__1, (char *)&beta[l - 1], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&alfa[l - 1], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&phi[l - 1], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& beo_ .di0[l - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& beo_ .dip0[l - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)&clo0[l - 1], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&clop0[l - 1], (ftnlen)sizeof(doublereal));
	}
	e_wsfe();
	s_wsfe(&io___3991);
	e_wsfe();
	s_wsfe(&io___3992);
	do_fio(&c__1, (char *)&etl, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&qwc[0], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&qwc[1], (ftnlen)sizeof(doublereal));
	e_wsfe();
	s_wsfe(&io___3993);
	e_wsfe();
	for (iv = 2; iv <= 5; ++iv) {
	    gtu1 += dtu[(iv << 1) - 2];
	    gtu2 += dtu[(iv << 1) - 1];
 
	}
	s_wsfe(&io___3994);
	do_fio(&c__1, (char *)&dtu[2], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&dtu[4], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&dtu[6], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&dtu[8], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&gtu1, (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&dtu[3], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&dtu[5], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&dtu[7], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&dtu[9], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&gtu2, (ftnlen)sizeof(doublereal));
	e_wsfe();
	for (i__ = 1; i__ <= 2; ++i__) {
	    for (j = 1; j <= 5; ++j) {
		for (l = 0; l <= 4; ++l) {
		    for (k = 0; k <= 4; ++k) {
			if (i__ == 2 && j == 1 && k == 1 && l == 1) {
			    s_wsfe(&io___3995);
			    e_wsfe();
			}
			if ((d__1 = dtup[i__ + (j + (k + l * 5) * 5 << 1) - 3]
				, (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
			    s_wsfe(&io___3996);
			    do_fio(&c__1, (char *)&dtup[i__ + (j + (k + l * 5)
				     * 5 << 1) - 3], (ftnlen)sizeof(
				    doublereal));
			    do_fio(&c__1, (char *)&k, (ftnlen)sizeof(integer))
				    ;
			    do_fio(&c__1, (char *)&l, (ftnlen)sizeof(integer))
				    ;
			    e_wsfe();
			}
 
		    }
		}
	    }
	}
	s_wsfe(&io___3997);
	e_wsfe();
	s_wsfe(&io___3998);
	e_wsfe();
	i__2 = subres_ .nte;
	for (np = subres_ .nta; np <= i__2; ++np) {
	    s_wsfe(&io___3999);
	    do_fio(&c__1, (char *)&np, (ftnlen)sizeof(integer));
	    e_wsfe();
	    s_wsfe(&io___4000);
	    e_wsfe();
	    vdt1 = nnf[np - 1] / (nz2[np - 1] * kons_ .pi);
	    np2 = np;
	    nkk = 0;
	    s_wsfe(&io___4002);
	    do_fio(&c__1, (char *)&np, (ftnlen)sizeof(integer));
	    e_wsfe();
	    goto L830;
L820:
	    s_wsfe(&io___4003);
	    do_fio(&c__1, (char *)&np, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)&np2, (ftnlen)sizeof(integer));
	    e_wsfe();
L830:
	    ++nkk;
	    n2e = np2 << 1;
	    i__3 = nkk;
	    for (i__ = 1; i__ <= i__3; ++i__) {
		i__4 = n2e;
		for (nv = 1; nv <= i__4; ++nv) {
		    n2 = nv - np2;
		    nn2 = (( n2 ) >= 0 ? ( n2 ) : -( n2 )) ;
		    nn1 = np2 - nn2;
		    nv1 = nn1 + (i__ - 1 << 1) + 1;
		    nv2 = np - nv1 + 2;
		    nv11 = nv1 - 1;
		    nv21 = nv2 - 1;
		    nf1 = nn1 + i__;
		    nf3 = nkk - i__ + 1;
		    nf4 = nf3 + nn2;
		    vdt2 = vdt1 * e[nv1 + nv2 * 10 - 11] / (nnf[nf1 - 1] * 
			    nnf[i__ - 1] * nnf[nf3 - 1] * nnf[nf4 - 1]);
		    vdt3 = nn2 * ea + nn1 * eb;
		    vdt4 = vdt3;
		    if (n2 >= 0) {
			vdt3 = n2 * nv21 * ea + nn1 * nv11 * eb;
		    }
		    secom_ .rtc[np2 + (nv + (np + i__ * 10) * 18) * 9 - 1792] 
			    = secom_ .rtc[np2 + (nv + (np + i__ * 10) * 18) * 
			    9 - 1792] * vdt2 * vdt3;
		    secom_ .rts[np2 + (nv + (np + i__ * 10) * 18) * 9 - 1792] 
			    = secom_ .rts[np2 + (nv + (np + i__ * 10) * 18) * 
			    9 - 1792] * vdt2 * vdt3;
 
		}
 
	    }
	    i__3 = n2e;
	    for (nv = 1; nv <= i__3; ++nv) {
		mis = 1;
		rc = 0.;
		rs = 0.;
		i__4 = nkk;
		for (i__ = 1; i__ <= i__4; ++i__) {
		    rc += mis * secom_ .rtc[np2 + (nv + (np + i__ * 10) * 18) 
			    * 9 - 1792];
		    rs += mis * secom_ .rts[np2 + (nv + (np + i__ * 10) * 18) 
			    * 9 - 1792];
		    mis = -mis;
 
		}
		sdel2 = sqrt(rc * rc + rs * rs);
		n22 = nv - np2;
		s_wsfe(&io___4017);
		do_fio(&c__1, (char *)&n22, (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)&ip[np2 + nv * 10 - 11], (ftnlen)sizeof(
			integer));
		do_fio(&c__1, (char *)&ipc, (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)&rc, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)&rs, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)&re[np2 + nv * 10 - 11], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)&sdel2, (ftnlen)sizeof(doublereal));
		e_wsfe();
 
	    }
	    np2 += -2;
	    if (np2 >= 1) {
		goto L820;
	    }
 
	}
	ntx = subres_ .nte - 2;
	s_wsfe(&io___4019);
	e_wsfe();
	i__2 = subres_ .nte;
	for (np = 1; np <= i__2; ++np) {
	    s_wsfe(&io___4020);
	    do_fio(&c__1, (char *)&np, (ftnlen)sizeof(integer));
	    e_wsfe();
	    n2e = np << 1;
	    i__3 = n2e;
	    for (nv = 1; nv <= i__3; ++nv) {
		n2 = nv - np;
		nkk = 2;
		nph = np + 2;
		min1 = -1;
L890:
		min2 = min1;
		i__4 = nkk;
		for (i__ = 1; i__ <= i__4; ++i__) {
		    secom_ .rtc[np + (nv + (np + 10) * 18) * 9 - 1792] += 
			    min2 * secom_ .rtc[np + (nv + (nph + i__ * 10) * 
			    18) * 9 - 1792];
		    secom_ .rts[np + (nv + (np + 10) * 18) * 9 - 1792] += 
			    min2 * secom_ .rts[np + (nv + (nph + i__ * 10) * 
			    18) * 9 - 1792];
		    min2 = -min2;
 
		}
		nph += 2;
		if (nph > subres_ .nte) {
		    goto L910;
		}
		++nkk;
		min1 = -min1;
		goto L890;
L910:
		cc = secom_ .rtc[np + (nv + (np + 10) * 18) * 9 - 1792];
		ss = secom_ .rts[np + (nv + (np + 10) * 18) * 9 - 1792];
		sdel = sqrt(cc * cc + ss * ss);
		s_wsfe(&io___4027);
		do_fio(&c__1, (char *)&n2, (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)&ip[np + nv * 10 - 11], (ftnlen)sizeof(
			integer));
		do_fio(&c__1, (char *)&ipc, (ftnlen)sizeof(integer));
		do_fio(&c__1, (char *)&cc, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)&ss, (ftnlen)sizeof(doublereal));
		do_fio(&c__1, (char *)&re[np + nv * 10 - 11], (ftnlen)sizeof(
			doublereal));
		do_fio(&c__1, (char *)&sdel, (ftnlen)sizeof(doublereal));
		e_wsfe();
 
	    }
 
	}
 
    }
    clorb_(& clo_ .ded);
    for (l = 1; l <= 2; ++l) {
	clo0[l - 1] = (tra_._1) .clo[l - 1];
	clop0[l - 1] = (tra_._1) .clop[l - 1];
 
    }
    clorb_(&c_b251);
    for (l = 1; l <= 2; ++l) {
	ll = l << 1;
	beo_ .di0[l - 1] = (clo0[l - 1] - (tra_._1) .clo[l - 1]) / clo_ .ded;
	beo_ .dip0[l - 1] = (clop0[l - 1] - (tra_._1) .clop[l - 1]) / clo_ .ded;
 
    }
 

    return 0;
}  

 
 
  int subsea_(dpp)
doublereal *dpp;
{
     
    integer i__1, i__2, i__3, i__4, i__5;
    doublereal d__1;

     
    double atan(), sqrt(), cos(), sin(), d_int();

     
    static doublereal tiltckuk, b[100]	 , e[100]	 
;
    static integer i__, j, k, l;
    static doublereal t[20]	 , b1, b2;
    static integer k1, l1, l2, n2;
    static doublereal r0, aa[11], bb[11], ea, eb;
    static integer dj;
    static doublereal ep[2], re[180]	 ;
    static integer ip[180]	 ;
    static doublereal cr[11], qw[2], ci[11];
    static integer ii;
    static doublereal dt;
    static integer ns, ik, ll, ix, jj, jm, jk;
    static doublereal qu, ab1[10], ab2[10], qv, xs, zs, xl, zl;
    static integer mx, im;
    static doublereal r0a;
    static integer np;
    static doublereal sb1, sb2;
    static integer n2e, nv;
    static doublereal re1;
    static integer mm, nn1, nn2, nf1, np2, nf3;
    static doublereal rn2;
    static integer nf4, nv1, nv2;
    static doublereal qu1;
    static integer nz2[9];
    static doublereal alfa[2], phi[2], dpr[5], beta[2];
    static integer nnf[10];
    static doublereal chy[162]	 , shy[162]	 
;
    static integer ium;
    static doublereal btc, bts, phy, del, pie, phibf[2], etl, radi;
    static integer izu;
    static doublereal dphi;
    extern   int envar_(), error_();
    static doublereal puf;
    static integer kpz, kzz;
    static doublereal dyy1, dyy2, ekk, crkve, cikve;
    static integer mpe;
    static doublereal cxzr, cxzi, cxzyi, dppi, cxzyr;
    static integer nmz;
    static doublereal benkr;
    extern   int clorb2_();
    static integer lmin;
    static doublereal dyy11, res;
    static integer nkk;
    static doublereal gerad, sea, seb, vdt1;
    static integer nv11, nv21;
    static doublereal vdt2, vdt3;
    extern   int betalf_();
    static doublereal tiltck, tiltsk, cxzyrr, tiltck1, tiltck2, tiltck3, 
	    tiltck4, tiltck5, tiltsk1, tiltsk2, tiltsk3, tiltsk4, tiltsk5;

 

 
 
 

 

    ium = 5;
    i__1 = ium;
    for (i__ = 1; i__ <= i__1; ++i__) {
	dpr[i__ - 1] = 0.;
 
    }
    i__1 = ium;
    for (i__ = 1; i__ <= i__1; ++i__) {
	for (j = 1; j <= 4; ++j) {
	    t[i__ + j * 5 - 6] = 0.;
 
	}
    }
    for (i__ = 1; i__ <= 2; ++i__) {
	beta[i__ - 1] = 0.;
	alfa[i__ - 1] = 0.;
	phi[i__ - 1] = 0.;
	phibf[i__ - 1] = 0.;
	qw[i__ - 1] = 0.;
	ep[i__ - 1] = 0.;
 
    }
    for (i__ = 1; i__ <= 10; ++i__) {
	nnf[i__ - 1] = 0;
	for (j = 1; j <= 18; ++j) {
	    ip[i__ + j * 10 - 11] = 0;
	    re[i__ + j * 10 - 11] = 0.;
 
	}
    }
    for (i__ = 1; i__ <= 11; ++i__) {
	aa[i__ - 1] = 0.;
	bb[i__ - 1] = 0.;
	cr[i__ - 1] = 0.;
	ci[i__ - 1] = 0.;
 
    }
    for (i__ = 1; i__ <= 9; ++i__) {
	nz2[i__ - 1] = 0;
	for (j = 1; j <= 18; ++j) {
	    chy[i__ + j * 9 - 10] = 0.;
	    shy[i__ + j * 9 - 10] = 0.;
	    for (k = 1; k <= 10; ++k) {
		for (ii = 1; ii <= 10; ++ii) {
		    e[k + ii * 10 - 11] = 0.;
		    b[k + ii * 10 - 11] = 0.;
 
		}
		for (l = 1; l <= 5; ++l) {
		    secom_ .rtc[i__ + (j + (k + l * 10) * 18) * 9 - 1792] = 
			    0.;
		    secom_ .rts[i__ + (j + (k + l * 10) * 18) * 9 - 1792] = 
			    0.;
 
		}
 
	    }
 
	}
 
    }
    btc = 0.;
    bts = 0.;
    phy = 0.;
    dt = 0.;
    del = 0.;
    ns = 0;
    ik = 0;
    pie = kons_ .pi * 2.;
    etl = 0.;
    radi = subres_ .totl / pie;
    dpr[0] = *dpp * 1e3;
    clorb2_(dpp);
    betalf_(dpp, qw);
    if (erro_ .ierro != 0) {
	i__1 = erro_ .ierro + 22;
	error_(&i__1);
    }
    envar_(dpp);
 
    for (l = 1; l <= 2; ++l) {
	ll = l << 1;
	alfa[l - 1] = (tra_._1) .alf0[l - 1];
	beta[l - 1] = (tra_._1) .bet0[l - 1];
	t[(ll - 1) * 5 - 5] = (tra_._1) .clo[l - 1];
 
	t[ll * 5 - 5] = (tra_._1) .clop[l - 1];
    }
    for (i__ = 1; i__ <= 4; ++i__) {
	for (j = 1; j <= 4; ++j) {
	    t[i__ + 1 + j * 5 - 6] = beo_ .ta[j + i__ * 6 - 7];
 
	    t[i__ + 1 + j * 5 - 6] = beo_ .ta[j + i__ * 6 - 7];
	}
    }
 
    ep[0] = subres_ .tam1 * subres_ .tam1 / beta[0];
    ep[1] = subres_ .tam2 * subres_ .tam2 / beta[1];
 
    izu = 0;
    i__1 = str_ .iu;
    for (k = 1; k <= i__1; ++k) {
	for (k1 = 1; k1 <= 10; ++k1) {
	    ab1[k1 - 1] = 0.;
 
	    ab2[k1 - 1] = 0.;
	}
	ix = str_ .ic[k - 1];
	if (ix > 300) {
	    goto L210;
	}
	jj = 0;
	dj = 1;
	if (ix > 0) {
	    goto L140;
	}
	ix = -ix;
	jj = str2_ .mel[ix - 1] + 1;
	dj = -1;
L140:
	jm = str2_ .mel[ix - 1];
 
	i__2 = jm;
	for (j = 1; j <= i__2; ++j) {
	    jj += dj;
	    jk = str2_ .mtyp[ix + jj * 300 - 301];
	    if (tit_ .ithick == 1 && ell_ .kz[jk - 1] != 0) {
		goto L170;
	    }
	    if (tit_ .ithick == 0 && ell_ .kz[jk - 1] != 0) {
		goto L740;
	    }
 
	    etl += ell_ .el[jk - 1];
	    for (l = 1; l <= 2; ++l) {
		ll = l << 1;
		if ((d__1 = t[ll + (ll - 1) * 5 - 6], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		    phibf[l - 1] = atan(t[ll + 1 + (ll - 1) * 5 - 6] / t[ll + 
			    (ll - 1) * 5 - 6]);
		} else {
		    phibf[l - 1] = kons_ .pi2;
		}
		i__3 = ium;
		for (i__ = 1; i__ <= i__3; ++i__) {
 
		    t[i__ + (ll - 1) * 5 - 6] += t[i__ + ll * 5 - 6] * 
			    ell_ .el[jk - 1];
		}
	    }
	    for (l = 1; l <= 2; ++l) {
		ll = l << 1;
		beta[l - 1] = t[ll + (ll - 1) * 5 - 6] * t[ll + (ll - 1) * 5 
			- 6] + t[ll + 1 + (ll - 1) * 5 - 6] * t[ll + 1 + (ll 
			- 1) * 5 - 6];
		alfa[l - 1] = -(t[ll + (ll - 1) * 5 - 6] * t[ll + ll * 5 - 6] 
			+ t[ll + 1 + (ll - 1) * 5 - 6] * t[ll + 1 + ll * 5 - 
			6]);
		if ((d__1 = t[ll + (ll - 1) * 5 - 6], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		    dphi = atan(t[ll + 1 + (ll - 1) * 5 - 6] / t[ll + (ll - 1)
			     * 5 - 6]) - phibf[l - 1];
		} else {
		    dphi = kons_ .pi2 - phibf[l - 1];
		}
		if (-dphi > 1e-17) {
		    dphi += kons_ .pi;
		}
 
		phi[l - 1] += dphi;
	    }
	    goto L200;
 
L170:
	    if (ell_ .kz[jk - 1] != 8) {
		etl += ell_ .el[jk - 1];
	    }
	    for (l = 1; l <= 2; ++l) {
		ll = l << 1;
		if ((d__1 = t[ll + (ll - 1) * 5 - 6], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		    phibf[l - 1] = atan(t[ll + 1 + (ll - 1) * 5 - 6] / t[ll + 
			    (ll - 1) * 5 - 6]);
		} else {
		    phibf[l - 1] = 0.;
		}
		i__3 = ium;
		for (i__ = 1; i__ <= i__3; ++i__) {
		    puf = t[i__ + (ll - 1) * 5 - 6];
		    t[i__ + (ll - 1) * 5 - 6] = puf * mat_ .a[jk + (l + 2) * 
			    700 - 2101] + t[i__ + ll * 5 - 6] * mat_ .a[jk + (
			    l + 4) * 700 - 2101] + dpr[i__ - 1] * mat_ .a[jk 
			    + (l + 10) * 700 - 2101];
 
		    t[i__ + ll * 5 - 6] = puf * mat_ .a[jk + (l + 6) * 700 - 
			    2101] + t[i__ + ll * 5 - 6] * mat_ .a[jk + (l + 8)
			     * 700 - 2101] + dpr[i__ - 1] * mat_ .a[jk + (l + 
			    12) * 700 - 2101];
		}
	    }
	    for (l = 1; l <= 2; ++l) {
		ll = l << 1;
		beta[l - 1] = t[ll + (ll - 1) * 5 - 6] * t[ll + (ll - 1) * 5 
			- 6] + t[ll + 1 + (ll - 1) * 5 - 6] * t[ll + 1 + (ll 
			- 1) * 5 - 6];
		alfa[l - 1] = -(t[ll + (ll - 1) * 5 - 6] * t[ll + ll * 5 - 6] 
			+ t[ll + 1 + (ll - 1) * 5 - 6] * t[ll + 1 + ll * 5 - 
			6]);
		if ((d__1 = t[ll + (ll - 1) * 5 - 6], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		    dphi = atan(t[ll + 1 + (ll - 1) * 5 - 6] / t[ll + (ll - 1)
			     * 5 - 6]) - phibf[l - 1];
		} else {
		    dphi = -phibf[l - 1];
		}
		if (-dphi > 1e-17) {
		    dphi += kons_ .pi;
		}
 
		phi[l - 1] += dphi;
	    }
L200:
	    ;
	}
	goto L740;
 
L210:
	ix += -300;
	qu = 0.;
	qv = 0.;
	kpz = ell_ .kp[ix - 1];
	if (kpz == 6) {
	    goto L740;
	}
	kzz = ell_ .kz[ix - 1];
	if (kzz == 0) {
	    goto L740;
	}
	dyy1 = 0.;
	dyy2 = 0.;
	if (rand0_ .iorg < 0) {
	    rand0_ .mzu[k - 1] = izu;
	}
	izu = rand0_ .mzu[k - 1] + 1;
	ekk = (ell_ .sm[ix - 1] + rand0_ .zfz[izu - 1] * ell_ .ek[ix - 1]) / (
		*dpp + 1.);
	++izu;
	xs = pla_ .xpl[ix - 1] + rand0_ .zfz[izu - 1] * pla_ .xrms[ix - 1];
	++izu;
	zs = pla_ .zpl[ix - 1] + rand0_ .zfz[izu - 1] * pla_ .zrms[ix - 1];
	xl = (t[0] - xs) * rand1_ .tiltc[k - 1] + (t[10] - zs) * 
		rand1_ .tilts[k - 1];
	zl = -(t[0] - xs) * rand1_ .tilts[k - 1] + (t[10] - zs) * 
		rand1_ .tiltc[k - 1];
	crkve = xl;
	cikve = zl;
	if (kzz < 0) {
	    goto L350;
	}
	switch ((int)kzz) {
	    case 1:  goto L220;
	    case 2:  goto L230;
	    case 3:  goto L240;
	    case 4:  goto L250;
	    case 5:  goto L260;
	    case 6:  goto L270;
	    case 7:  goto L280;
	    case 8:  goto L290;
	    case 9:  goto L300;
	    case 10:  goto L310;
	    case 11:  goto L320;
	}
	goto L740;
 
L220:
	ekk *= 1e3;
	mpe = 20;
	dyy1 = ekk * rand1_ .tiltc[k - 1];
	dyy2 = ekk * rand1_ .tilts[k - 1];
	qu = 0.;
	qv = 0.;
	goto L460;
 
L230:
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * xl + rand1_ .tilts[k - 1] * zl);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * zl + rand1_ .tilts[k - 1] * xl);
	mpe = 20;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * tiltck;
	qv = -ekk * tiltsk;
	ab1[1] = qu;
	ab2[1] = -qv;
	goto L460;
 
L240:
	ekk *= .001;
	mpe = 3;
	mx = 1;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cxzyi + rand1_ .tilts[k - 1] * 
		cxzyr);
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 2. * (tiltck * xl + tiltsk * zl);
	qv = ekk * 2. * (tiltck * zl - tiltsk * xl);
	ab1[1] = qu;
	ab2[1] = -qv;
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[2] = ekk * tiltck;
	ab2[2] = ekk * tiltsk;
	goto L460;
 
L250:
	ekk *= 1e-6;
	mpe = 4;
	mx = 2;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 3. * (tiltck * cxzyr + tiltsk * cxzyi);
	qv = ekk * 3. * (tiltck * cxzyi - tiltsk * cxzyr);
	ab1[1] = qu;
	ab2[1] = -qv;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cxzyi + rand1_ .tilts[k - 1] * 
		cxzyr);
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[2] = ekk * 3. * (tiltck * xl + tiltsk * zl);
	ab2[2] = ekk * 3. * (-tiltck * zl + tiltsk * xl);
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[3] = ekk * tiltck;
	ab2[3] = ekk * tiltsk;
	goto L460;
 
L260:
	ekk *= 1e-9;
	mpe = 5;
	mx = 3;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk1 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 
		1];
	tiltck1 = tiltckuk;
	ab1[2] = ekk * 6 * (tiltck1 * cxzyr + tiltsk1 * cxzyi);
	ab2[2] = ekk * 6 * (-tiltck1 * cxzyi + tiltsk1 * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	qu = ekk * 4. * (tiltck * cxzyr + tiltsk * cxzyi);
	qv = ekk * 4. * (tiltck * cxzyi - tiltsk * cxzyr);
	ab1[1] = qu;
	ab2[1] = -qv;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cxzyi + rand1_ .tilts[k - 1] * 
		cxzyr);
	tiltckuk = tiltck1 * rand1_ .tiltc[k - 1] - tiltsk1 * rand1_ .tilts[k 
		- 1];
	tiltsk = tiltck1 * rand1_ .tilts[k - 1] + tiltsk1 * rand1_ .tiltc[k - 
		1];
	tiltck = tiltckuk;
	ab1[3] = ekk * 4. * (tiltck * xl + tiltsk * zl);
	ab2[3] = ekk * 4. * (-tiltck * zl + tiltsk * xl);
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[4] = ekk * tiltck;
	ab2[4] = ekk * tiltsk;
	goto L460;
 
L270:
	ekk *= 1e-12;
	mpe = 6;
	mx = 4;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk1 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 
		1];
	tiltck1 = tiltckuk;
	tiltckuk = tiltck1 * rand1_ .tiltc[k - 1] - tiltsk1 * rand1_ .tilts[k 
		- 1];
	tiltsk2 = tiltck1 * rand1_ .tilts[k - 1] + tiltsk1 * rand1_ .tiltc[k 
		- 1];
	tiltck2 = tiltckuk;
	ab1[3] = ekk * 10 * (tiltck2 * cxzyr + tiltsk2 * cxzyi);
	ab2[3] = ekk * 10 * (-tiltck2 * cxzyi + tiltsk2 * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[2] = ekk * 10 * (tiltck1 * cxzyr + tiltsk1 * cxzyi);
	ab2[2] = ekk * 10 * (-tiltck1 * cxzyi + tiltsk1 * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	qu = ekk * 5 * (tiltck * cxzyr + tiltsk * cxzyi);
	qv = ekk * 5 * (tiltck * cxzyi - tiltsk * cxzyr);
	ab1[1] = qu;
	ab2[1] = -qv;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cxzyi + rand1_ .tilts[k - 1] * 
		cxzyr);
	tiltckuk = tiltck2 * rand1_ .tiltc[k - 1] - tiltsk2 * rand1_ .tilts[k 
		- 1];
	tiltsk = tiltck2 * rand1_ .tilts[k - 1] + tiltsk2 * rand1_ .tiltc[k - 
		1];
	tiltck = tiltckuk;
	ab1[4] = ekk * 5 * (tiltck * xl + tiltsk * zl);
	ab2[4] = ekk * 5 * (-tiltck * zl + tiltsk * xl);
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[5] = ekk * tiltck;
	ab2[5] = ekk * tiltsk;
	goto L460;
 
L280:
	ekk *= 1e-15;
	mpe = 7;
	mx = 5;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk1 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 
		1];
	tiltck1 = tiltckuk;
	tiltckuk = tiltck1 * rand1_ .tiltc[k - 1] - tiltsk1 * rand1_ .tilts[k 
		- 1];
	tiltsk2 = tiltck1 * rand1_ .tilts[k - 1] + tiltsk1 * rand1_ .tiltc[k 
		- 1];
	tiltck2 = tiltckuk;
	tiltckuk = tiltck2 * rand1_ .tiltc[k - 1] - tiltsk2 * rand1_ .tilts[k 
		- 1];
	tiltsk3 = tiltck2 * rand1_ .tilts[k - 1] + tiltsk2 * rand1_ .tiltc[k 
		- 1];
	tiltck3 = tiltckuk;
	ab1[4] = ekk * 15 * (tiltck3 * cxzyr + tiltsk3 * cxzyi);
	ab2[4] = ekk * 15 * (-tiltck3 * cxzyi + tiltsk3 * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[3] = ekk * 20 * (tiltck2 * cxzyr + tiltsk2 * cxzyi);
	ab2[3] = ekk * 20 * (-tiltck2 * cxzyi + tiltsk2 * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[4] = ekk * 15 * (tiltck1 * cxzyr + tiltsk1 * cxzyi);
	ab2[4] = ekk * 15 * (-tiltck1 * cxzyi + tiltsk1 * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	qu = ekk * 6 * (tiltck * cxzyr + tiltsk * cxzyi);
	qv = ekk * 6 * (tiltck * cxzyi - tiltsk * cxzyr);
	ab1[1] = qu;
	ab2[1] = -qv;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cxzyi + rand1_ .tilts[k - 1] * 
		cxzyr);
	tiltckuk = tiltck3 * rand1_ .tiltc[k - 1] - tiltsk3 * rand1_ .tilts[k 
		- 1];
	tiltsk = tiltck3 * rand1_ .tilts[k - 1] + tiltsk3 * rand1_ .tiltc[k - 
		1];
	tiltck = tiltckuk;
	ab1[5] = ekk * 6 * (tiltck * xl + tiltsk * zl);
	ab2[5] = ekk * 6 * (-tiltck * zl + tiltsk * xl);
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[6] = ekk * tiltck;
	ab2[6] = ekk * tiltsk;
	goto L460;
 
L290:
	ekk *= 1e-18;
	mpe = 8;
	mx = 6;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk1 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 
		1];
	tiltck1 = tiltckuk;
	tiltckuk = tiltck1 * rand1_ .tiltc[k - 1] - tiltsk1 * rand1_ .tilts[k 
		- 1];
	tiltsk2 = tiltck1 * rand1_ .tilts[k - 1] + tiltsk1 * rand1_ .tiltc[k 
		- 1];
	tiltck2 = tiltckuk;
	tiltckuk = tiltck2 * rand1_ .tiltc[k - 1] - tiltsk2 * rand1_ .tilts[k 
		- 1];
	tiltsk3 = tiltck2 * rand1_ .tilts[k - 1] + tiltsk2 * rand1_ .tiltc[k 
		- 1];
	tiltck3 = tiltckuk;
	tiltckuk = tiltck3 * rand1_ .tiltc[k - 1] - tiltsk3 * rand1_ .tilts[k 
		- 1];
	tiltsk4 = tiltck3 * rand1_ .tilts[k - 1] + tiltsk3 * rand1_ .tiltc[k 
		- 1];
	tiltck4 = tiltckuk;
	ab1[5] = ekk * 21 * (tiltck4 * cxzyr + tiltsk4 * cxzyi);
	ab2[5] = ekk * 21 * (-tiltck4 * cxzyi + tiltsk4 * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[4] = ekk * 35 * (tiltck3 * cxzyr + tiltsk3 * cxzyi);
	ab2[4] = ekk * 35 * (-tiltck3 * cxzyi + tiltsk3 * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[3] = ekk * 35 * (tiltck2 * cxzyr + tiltsk2 * cxzyi);
	ab2[3] = ekk * 35 * (-tiltck2 * cxzyi + tiltsk2 * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[2] = ekk * 21 * (tiltck1 * cxzyr + tiltsk1 * cxzyi);
	ab2[2] = ekk * 21 * (-tiltck1 * cxzyi + tiltsk1 * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	qu = ekk * 7 * (tiltck * cxzyr + tiltsk * cxzyi);
	qv = ekk * 7 * (tiltck * cxzyi - tiltsk * cxzyr);
	ab1[1] = qu;
	ab2[1] = -qv;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cxzyi + rand1_ .tilts[k - 1] * 
		cxzyr);
	tiltckuk = tiltck4 * rand1_ .tiltc[k - 1] - tiltsk4 * rand1_ .tilts[k 
		- 1];
	tiltsk = tiltck4 * rand1_ .tilts[k - 1] + tiltsk4 * rand1_ .tiltc[k - 
		1];
	tiltck = tiltckuk;
	ab1[6] = ekk * 7 * (tiltck * xl + tiltsk * zl);
	ab2[6] = ekk * 7 * (-tiltck * zl + tiltsk * xl);
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[7] = ekk * tiltck;
	ab2[7] = ekk * tiltsk;
	goto L460;
 
L300:
	ekk *= 1e-21;
	mpe = 9;
	mx = 7;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk1 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 
		1];
	tiltck1 = tiltckuk;
	tiltckuk = tiltck1 * rand1_ .tiltc[k - 1] - tiltsk1 * rand1_ .tilts[k 
		- 1];
	tiltsk2 = tiltck1 * rand1_ .tilts[k - 1] + tiltsk1 * rand1_ .tiltc[k 
		- 1];
	tiltck2 = tiltckuk;
	tiltckuk = tiltck2 * rand1_ .tiltc[k - 1] - tiltsk2 * rand1_ .tilts[k 
		- 1];
	tiltsk3 = tiltck2 * rand1_ .tilts[k - 1] + tiltsk2 * rand1_ .tiltc[k 
		- 1];
	tiltck3 = tiltckuk;
	tiltckuk = tiltck3 * rand1_ .tiltc[k - 1] - tiltsk3 * rand1_ .tilts[k 
		- 1];
	tiltsk4 = tiltck3 * rand1_ .tilts[k - 1] + tiltsk3 * rand1_ .tiltc[k 
		- 1];
	tiltck4 = tiltckuk;
	tiltckuk = tiltck4 * rand1_ .tiltc[k - 1] - tiltsk4 * rand1_ .tilts[k 
		- 1];
	tiltsk5 = tiltck4 * rand1_ .tilts[k - 1] + tiltsk4 * rand1_ .tiltc[k 
		- 1];
	tiltck5 = tiltckuk;
	ab1[6] = ekk * 28 * (tiltck5 * cxzyr + tiltsk5 * cxzyi);
	ab2[6] = ekk * 28 * (-tiltck5 * cxzyi + tiltsk5 * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[5] = ekk * 56 * (tiltck4 * cxzyr + tiltsk4 * cxzyi);
	ab2[5] = ekk * 56 * (-tiltck4 * cxzyi + tiltsk4 * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[4] = ekk * 70 * (tiltck3 * cxzyr + tiltsk3 * cxzyi);
	ab2[4] = ekk * 70 * (-tiltck3 * cxzyi + tiltsk3 * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[3] = ekk * 56 * (tiltck2 * cxzyr + tiltsk2 * cxzyi);
	ab2[3] = ekk * 56 * (-tiltck2 * cxzyi + tiltsk2 * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[2] = ekk * 28 * (tiltck1 * cxzyr + tiltsk1 * cxzyi);
	ab2[2] = ekk * 28 * (-tiltck1 * cxzyi + tiltsk1 * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	qu = ekk * 8 * (tiltck * cxzyr + tiltsk * cxzyi);
	qv = ekk * 8 * (tiltck * cxzyi - tiltsk * cxzyr);
	ab1[1] = qu;
	ab2[1] = -qv;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cxzyi + rand1_ .tilts[k - 1] * 
		cxzyr);
	tiltckuk = tiltck5 * rand1_ .tiltc[k - 1] - tiltsk5 * rand1_ .tilts[k 
		- 1];
	tiltsk = tiltck5 * rand1_ .tilts[k - 1] + tiltsk5 * rand1_ .tiltc[k - 
		1];
	tiltck = tiltckuk;
	ab1[7] = ekk * 8 * (tiltck * xl + tiltsk * zl);
	ab2[7] = ekk * 8 * (-tiltck * zl + tiltsk * xl);
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[8] = ekk * tiltck;
	ab2[8] = ekk * tiltsk;
	goto L460;
 
L310:
	ekk *= 1e-24;
	mpe = 20;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 9 * (tiltck * cxzyr + tiltsk * cxzyi);
	qv = ekk * 9 * (tiltck * cxzyi - tiltsk * cxzyr);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
	dyy2 = ekk * (- rand1_ .tiltc[k - 1] * cxzyi + rand1_ .tilts[k - 1] * 
		cxzyr);
	goto L460;
L320:
	r0 = ell_ .ek[ix - 1];
	if ((d__1 = dkic_ .dki[ix - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
	    if ((d__1 = dkic_ .dki[ix + 1399], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		qu = - dkic_ .dki[ix - 1] / dkic_ .dki[ix + 1399] * dkic_ .dki[
			ix - 1] / (*dpp + 1.);
		dppi = dkic_ .dki[ix - 1] * 1e3 / (*dpp + 1.);
		t[5] = t[5] + (qu * xl - dppi * *dpp) * rand1_ .tiltc[k - 1] 
			+ dppi * (1. - rand1_ .tiltc[k - 1]);
		t[15] = t[15] + (qu * xl - dppi * *dpp) * rand1_ .tilts[k - 1]
			 + dppi * rand1_ .tilts[k - 1];
		i__2 = ium;
		for (i__ = 2; i__ <= i__2; ++i__) {
		    t[i__ + 4] += qu * t[i__ - 1] * rand1_ .tiltc[k - 1];
		    t[i__ + 14] += qu * t[i__ + 9] * rand1_ .tilts[k - 1];
 
		}
	    } else {
		dppi = dkic_ .dki[ix - 1] * 1e3 / (*dpp + 1.);
		t[5] = t[5] - dppi * *dpp * rand1_ .tiltc[k - 1] + dppi * (1. 
			- rand1_ .tiltc[k - 1]);
		t[15] = t[15] - dppi * *dpp * rand1_ .tilts[k - 1] + dppi * 
			rand1_ .tilts[k - 1];
	    }
	}
	if ((d__1 = dkic_ .dki[ix + 699], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
	    if ((d__1 = dkic_ .dki[ix + 1399], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		qu = dkic_ .dki[ix + 699] / dkic_ .dki[ix + 1399] * 
			dkic_ .dki[ix + 699] / (*dpp + 1.);
		dppi = dkic_ .dki[ix + 699] * 1e3 / (*dpp + 1.);
		t[5] = t[5] + (qu * zl - dppi * *dpp) * rand1_ .tilts[k - 1] 
			+ dppi * rand1_ .tilts[k - 1];
		t[15] = t[15] + (-qu * zl + dppi * *dpp) * rand1_ .tiltc[k - 
			1] - dppi * (1. - rand1_ .tiltc[k - 1]);
		i__2 = ium;
		for (i__ = 2; i__ <= i__2; ++i__) {
		    t[i__ + 4] += qu * t[i__ - 1] * rand1_ .tilts[k - 1];
		    t[i__ + 14] -= qu * t[i__ + 9] * rand1_ .tiltc[k - 1];
 
		}
	    } else {
		dppi = dkic_ .dki[ix + 699] * 1e3 / (*dpp + 1.);
		t[5] = t[5] - dppi * *dpp * rand1_ .tilts[k - 1] + dppi * 
			rand1_ .tilts[k - 1];
		t[15] = t[15] + dppi * *dpp * rand1_ .tiltc[k - 1] - dppi * (
			1. - rand1_ .tiltc[k - 1]);
	    }
	}
	mpe = 9;
	mx = 0;
	if ((( r0 ) >= 0 ? ( r0 ) : -( r0 ))  <= 1e-17) {
	    goto L740;
	}
	nmz = mult1_ .nmu[ix - 1];
	if (nmz == 0) {
	    izu += 22;
	    goto L740;
	}
	im = mult1_ .irm[ix - 1];
	r0a = 1.;
	benkr = ell_ .ed[ix - 1] / (*dpp + 1.);
	cr[0] = 1.;
	cr[1] = xl;
	ci[1] = zl;
	cxzyr = xl;
	cxzyi = zl;
	cxzr = cxzyi;
	cxzi = cxzyi;
	dyy1 = 0.;
	dyy2 = 0.;
	qu = 0.;
	qv = 0.;
	lmin = 3;
	if (nmz == 1) {
	    lmin = 2;
	}
	for (l = lmin; l <= 11; ++l) {
	    cr[l - 1] = 0.;
 
	    ci[l - 1] = 0.;
	}
	i__2 = nmz;
	for (l = 1; l <= i__2; ++l) {
	    l1 = l - 1;
	    ++izu;
	    aa[l - 1] = multi_ .ak0[im + l * 700 - 701] + rand0_ .zfz[izu - 1]
		     * multi_ .aka[im + l * 700 - 701];
	    aa[l - 1] = benkr * aa[l - 1] / r0a;
	    ++izu;
	    bb[l - 1] = multi_ .bk0[im + l * 700 - 701] + rand0_ .zfz[izu - 1]
		     * multi_ .bka[im + l * 700 - 701];
	    bb[l - 1] = benkr * bb[l - 1] / r0a;
	    r0a *= r0;
	    if (l > 2) {
		cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
		cxzyi = cxzyr * cxzi + cxzyi * cxzr;
		cxzyr = cxzyrr;
		cr[l - 1] = cxzyr;
		ci[l - 1] = cxzyi;
	    }
	    dyy1 = dyy1 + bb[l - 1] * cr[l - 1] + aa[l - 1] * ci[l - 1];
	    dyy2 = dyy2 - bb[l - 1] * ci[l - 1] + aa[l - 1] * cr[l - 1];
	    if (l > 1 && ium != 1) {
		qu += l1 * (bb[l - 1] * cr[l1 - 1] + aa[l - 1] * ci[l1 - 1]);
		qv += l1 * (bb[l - 1] * ci[l1 - 1] - aa[l - 1] * cr[l1 - 1]);
	    }
 
	}
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu1 = tiltck * qu - tiltsk * qv;
	qv = tiltck * qv + tiltsk * qu;
	qu = qu1;
	dyy11 = rand1_ .tiltc[k - 1] * dyy1 - rand1_ .tilts[k - 1] * dyy2;
	dyy2 = rand1_ .tiltc[k - 1] * dyy2 + rand1_ .tilts[k - 1] * dyy1;
	dyy1 = dyy11;
	izu = izu + 22 - (nmz << 1);
	goto L460;
 
L350:
	kzz = -kzz;
	switch ((int)kzz) {
	    case 1:  goto L360;
	    case 2:  goto L370;
	    case 3:  goto L380;
	    case 4:  goto L390;
	    case 5:  goto L400;
	    case 6:  goto L410;
	    case 7:  goto L420;
	    case 8:  goto L430;
	    case 9:  goto L440;
	    case 10:  goto L450;
	}
	goto L740;
 
L360:
	ekk *= 1e3;
	mpe = 20;
	dyy1 = -ekk * rand1_ .tilts[k - 1];
	dyy2 = ekk * rand1_ .tiltc[k - 1];
	qu = 0.;
	qv = 0.;
	goto L460;
 
L370:
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * zl - rand1_ .tilts[k - 1] * xl);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * xl + rand1_ .tilts[k - 1] * zl);
	mpe = 2;
	mx = -1;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = -ekk * tiltsk;
	qv = -ekk * tiltck;
	ab1[1] = qu;
	ab2[1] = -qv;
	goto L460;
 
L380:
	ekk *= .001;
	mpe = 3;
	mx = 1;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyi - rand1_ .tilts[k - 1] * 
		cxzyr);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 2. * (tiltck * zl - tiltsk * xl);
	qv = -ekk * 2. * (tiltck * xl + tiltsk * zl);
	ab1[1] = qu;
	ab2[1] = -qv;
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[2] = ekk * tiltsk;
	ab2[2] = ekk * tiltck;
	goto L460;
 
L390:
	ekk *= 1e-6;
	mpe = 4;
	mx = 2;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 3. * (tiltck * cxzyi - tiltsk * cxzyr);
	qv = ekk * -3. * (tiltck * cxzyr + tiltsk * cxzyi);
	ab1[1] = qu;
	ab2[1] = -qv;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyi - rand1_ .tilts[k - 1] * 
		cxzyr);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[2] = ekk * 3. * (tiltck * zl - tiltsk * xl);
	ab2[2] = ekk * 3. * (tiltck * xl + tiltsk * zl);
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[3] = ekk * tiltsk;
	ab2[3] = ekk * tiltck;
	goto L460;
 
L400:
	ekk *= 1e-9;
	mpe = 5;
	mx = 3;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk1 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 
		1];
	tiltck1 = tiltckuk;
	ab1[2] = ekk * 6 * (tiltck1 * cxzyi - tiltsk1 * cxzyr);
	ab2[2] = ekk * 6 * (tiltck1 * cxzyr + tiltsk1 * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	qu = ekk * 4. * (tiltck * cxzyi - tiltsk * cxzyr);
	qv = ekk * -4. * (tiltck * cxzyr + tiltsk * cxzyi);
	ab1[1] = qu;
	ab2[1] = -qv;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyi - rand1_ .tilts[k - 1] * 
		cxzyr);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
	tiltckuk = tiltck1 * rand1_ .tiltc[k - 1] - tiltsk1 * rand1_ .tilts[k 
		- 1];
	tiltsk = tiltck1 * rand1_ .tilts[k - 1] + tiltsk1 * rand1_ .tiltc[k - 
		1];
	tiltck = tiltckuk;
	ab1[3] = ekk * 4. * (tiltck * zl - tiltsk * xl);
	ab2[3] = ekk * 4. * (tiltck * xl + tiltsk * zl);
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[4] = ekk * tiltsk;
	ab2[4] = ekk * tiltck;
	goto L460;
 
L410:
	ekk *= 1e-12;
	mpe = 6;
	mx = 4;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk1 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 
		1];
	tiltck1 = tiltckuk;
	tiltckuk = tiltck1 * rand1_ .tiltc[k - 1] - tiltsk1 * rand1_ .tilts[k 
		- 1];
	tiltsk2 = tiltck1 * rand1_ .tilts[k - 1] + tiltsk1 * rand1_ .tiltc[k 
		- 1];
	tiltck2 = tiltckuk;
	ab1[3] = ekk * 10 * (tiltck2 * cxzyi - tiltsk2 * cxzyr);
	ab2[3] = ekk * 10 * (tiltck2 * cxzyr + tiltsk2 * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[2] = ekk * 10 * (tiltck1 * cxzyi - tiltsk1 * cxzyr);
	ab2[2] = ekk * 10 * (tiltck1 * cxzyr + tiltsk1 * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	qu = ekk * 5 * (tiltck * cxzyi - tiltsk * cxzyr);
	qv = ekk * -5 * (tiltck * cxzyr + tiltsk * cxzyi);
	ab1[1] = qu;
	ab2[1] = -qv;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyi - rand1_ .tilts[k - 1] * 
		cxzyr);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
	tiltckuk = tiltck2 * rand1_ .tiltc[k - 1] - tiltsk2 * rand1_ .tilts[k 
		- 1];
	tiltsk = tiltck2 * rand1_ .tilts[k - 1] + tiltsk2 * rand1_ .tiltc[k - 
		1];
	tiltck = tiltckuk;
	ab1[4] = ekk * 5 * (tiltck * zl - tiltsk * xl);
	ab2[4] = ekk * 5 * (tiltck * xl + tiltsk * zl);
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[5] = ekk * tiltsk;
	ab2[5] = ekk * tiltck;
	goto L460;
 
L420:
	ekk *= 1e-15;
	mpe = 7;
	mx = 5;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk1 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 
		1];
	tiltck1 = tiltckuk;
	tiltckuk = tiltck1 * rand1_ .tiltc[k - 1] - tiltsk1 * rand1_ .tilts[k 
		- 1];
	tiltsk2 = tiltck1 * rand1_ .tilts[k - 1] + tiltsk1 * rand1_ .tiltc[k 
		- 1];
	tiltck2 = tiltckuk;
	tiltckuk = tiltck2 * rand1_ .tiltc[k - 1] - tiltsk2 * rand1_ .tilts[k 
		- 1];
	tiltsk3 = tiltck2 * rand1_ .tilts[k - 1] + tiltsk2 * rand1_ .tiltc[k 
		- 1];
	tiltck3 = tiltckuk;
	ab1[4] = ekk * 15 * (tiltck3 * cxzyi - tiltsk3 * cxzyr);
	ab2[4] = ekk * 15 * (tiltck3 * cxzyr + tiltsk3 * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[3] = ekk * 20 * (tiltck2 * cxzyi - tiltsk2 * cxzyr);
	ab2[3] = ekk * 20 * (tiltck2 * cxzyr + tiltsk2 * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[2] = ekk * 15 * (tiltck1 * cxzyi - tiltsk1 * cxzyr);
	ab2[2] = ekk * 15 * (tiltck1 * cxzyr + tiltsk1 * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	qu = ekk * 6 * (tiltck * cxzyi - tiltsk * cxzyr);
	qv = ekk * -6 * (tiltck * cxzyr + tiltsk * cxzyi);
	ab1[1] = qu;
	ab2[1] = -qv;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyi - rand1_ .tilts[k - 1] * 
		cxzyr);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
	tiltckuk = tiltck3 * rand1_ .tiltc[k - 1] - tiltsk3 * rand1_ .tilts[k 
		- 1];
	tiltsk = tiltck3 * rand1_ .tilts[k - 1] + tiltsk3 * rand1_ .tiltc[k - 
		1];
	tiltck = tiltckuk;
	ab1[5] = ekk * 6 * (tiltck * zl - tiltsk * xl);
	ab2[5] = ekk * 6 * (tiltck * xl + tiltsk * zl);
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[6] = ekk * tiltsk;
	ab2[6] = ekk * tiltck;
	goto L460;
 
L430:
	ekk *= 1e-18;
	mpe = 8;
	mx = 6;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk1 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 
		1];
	tiltck1 = tiltckuk;
	tiltckuk = tiltck1 * rand1_ .tiltc[k - 1] - tiltsk1 * rand1_ .tilts[k 
		- 1];
	tiltsk2 = tiltck1 * rand1_ .tilts[k - 1] + tiltsk1 * rand1_ .tiltc[k 
		- 1];
	tiltck2 = tiltckuk;
	tiltckuk = tiltck2 * rand1_ .tiltc[k - 1] - tiltsk2 * rand1_ .tilts[k 
		- 1];
	tiltsk3 = tiltck2 * rand1_ .tilts[k - 1] + tiltsk2 * rand1_ .tiltc[k 
		- 1];
	tiltck3 = tiltckuk;
	tiltckuk = tiltck3 * rand1_ .tiltc[k - 1] - tiltsk3 * rand1_ .tilts[k 
		- 1];
	tiltsk4 = tiltck3 * rand1_ .tilts[k - 1] + tiltsk3 * rand1_ .tiltc[k 
		- 1];
	tiltck4 = tiltckuk;
	ab1[5] = ekk * 21 * (tiltck4 * cxzyi - tiltsk4 * cxzyr);
	ab2[5] = ekk * 21 * (tiltck4 * cxzyr + tiltsk4 * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[4] = ekk * 35 * (tiltck3 * cxzyi - tiltsk3 * cxzyr);
	ab2[4] = ekk * 35 * (tiltck3 * cxzyr + tiltsk3 * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[3] = ekk * 35 * (tiltck2 * cxzyi - tiltsk2 * cxzyr);
	ab2[3] = ekk * 35 * (tiltck2 * cxzyr + tiltsk2 * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[2] = ekk * 21 * (tiltck1 * cxzyi - tiltsk1 * cxzyr);
	ab2[2] = ekk * 21 * (tiltck1 * cxzyr + tiltsk1 * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	qu = ekk * 7 * (tiltck * cxzyi - tiltsk * cxzyr);
	qv = ekk * -7 * (tiltck * cxzyr + tiltsk * cxzyi);
	ab1[1] = qu;
	ab2[1] = -qv;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyi - rand1_ .tilts[k - 1] * 
		cxzyr);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
	tiltckuk = tiltck4 * rand1_ .tiltc[k - 1] - tiltsk4 * rand1_ .tilts[k 
		- 1];
	tiltsk = tiltck4 * rand1_ .tilts[k - 1] + tiltsk4 * rand1_ .tiltc[k - 
		1];
	tiltck = tiltckuk;
	ab1[6] = ekk * 7 * (tiltck * zl - tiltsk * xl);
	ab2[6] = ekk * 7 * (tiltck * xl + tiltsk * zl);
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[7] = ekk * tiltsk;
	ab2[7] = ekk * tiltck;
	goto L460;
 
L440:
	ekk *= 1e-21;
	mpe = 9;
	mx = 7;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk1 = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 
		1];
	tiltck1 = tiltckuk;
	tiltckuk = tiltck1 * rand1_ .tiltc[k - 1] - tiltsk1 * rand1_ .tilts[k 
		- 1];
	tiltsk2 = tiltck1 * rand1_ .tilts[k - 1] + tiltsk1 * rand1_ .tiltc[k 
		- 1];
	tiltck2 = tiltckuk;
	tiltckuk = tiltck2 * rand1_ .tiltc[k - 1] - tiltsk2 * rand1_ .tilts[k 
		- 1];
	tiltsk3 = tiltck2 * rand1_ .tilts[k - 1] + tiltsk2 * rand1_ .tiltc[k 
		- 1];
	tiltck3 = tiltckuk;
	tiltckuk = tiltck3 * rand1_ .tiltc[k - 1] - tiltsk3 * rand1_ .tilts[k 
		- 1];
	tiltsk4 = tiltck3 * rand1_ .tilts[k - 1] + tiltsk3 * rand1_ .tiltc[k 
		- 1];
	tiltck4 = tiltckuk;
	tiltckuk = tiltck4 * rand1_ .tiltc[k - 1] - tiltsk4 * rand1_ .tilts[k 
		- 1];
	tiltsk5 = tiltck4 * rand1_ .tilts[k - 1] + tiltsk4 * rand1_ .tiltc[k 
		- 1];
	tiltck5 = tiltckuk;
	ab1[6] = ekk * 28 * (tiltck5 * cxzyi - tiltsk5 * cxzyr);
	ab2[6] = ekk * 28 * (tiltck5 * cxzyr + tiltsk5 * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[5] = ekk * 56 * (tiltck4 * cxzyi - tiltsk4 * cxzyr);
	ab2[5] = ekk * 56 * (tiltck4 * cxzyr + tiltsk4 * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[4] = ekk * 70 * (tiltck3 * cxzyi - tiltsk3 * cxzyr);
	ab2[4] = ekk * 70 * (tiltck3 * cxzyr + tiltsk3 * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[3] = ekk * 56 * (tiltck2 * cxzyi - tiltsk2 * cxzyr);
	ab2[3] = ekk * 56 * (tiltck2 * cxzyr + tiltsk2 * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	ab1[2] = ekk * 28 * (tiltck1 * cxzyi - tiltsk1 * cxzyr);
	ab2[2] = ekk * 28 * (tiltck1 * cxzyr + tiltsk1 * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	qu = ekk * 8 * (tiltck * cxzyi - tiltsk * cxzyr);
	qv = ekk * -8 * (tiltck * cxzyr + tiltsk * cxzyi);
	ab1[1] = qu;
	ab2[1] = -qv;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyi - rand1_ .tilts[k - 1] * 
		cxzyr);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
	tiltckuk = tiltck5 * rand1_ .tiltc[k - 1] - tiltsk5 * rand1_ .tilts[k 
		- 1];
	tiltsk = tiltck5 * rand1_ .tilts[k - 1] + tiltsk5 * rand1_ .tiltc[k - 
		1];
	tiltck = tiltckuk;
	ab1[7] = ekk * 8 * (tiltck * zl - tiltsk * xl);
	ab2[7] = ekk * 8 * (tiltck * xl + tiltsk * zl);
	tiltckuk = tiltck * rand1_ .tiltc[k - 1] - tiltsk * rand1_ .tilts[k - 
		1];
	tiltsk = tiltck * rand1_ .tilts[k - 1] + tiltsk * rand1_ .tiltc[k - 1]
		;
	tiltck = tiltckuk;
	ab1[8] = ekk * tiltsk;
	ab2[8] = ekk * tiltck;
	goto L460;
 
L450:
	ekk *= 1e-24;
	mpe = 20;
	cxzr = xl;
	cxzi = zl;
	cxzyr = cxzr * cxzr - cxzi * cxzi;
	cxzyi = cxzr * cxzi + cxzi * cxzr;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * 9 * (tiltck * cxzyi - tiltsk * cxzyr);
	qv = ekk * -9 * (tiltck * cxzyr + tiltsk * cxzyi);
	cxzyrr = cxzyr * cxzr - cxzyi * cxzi;
	cxzyi = cxzyr * cxzi + cxzyi * cxzr;
	cxzyr = cxzyrr;
	dyy1 = ekk * (rand1_ .tiltc[k - 1] * cxzyi - rand1_ .tilts[k - 1] * 
		cxzyr);
	dyy2 = ekk * (rand1_ .tiltc[k - 1] * cxzyr + rand1_ .tilts[k - 1] * 
		cxzyi);
L460:
	t[5] += dyy1;
	t[15] += dyy2;
	i__2 = ium;
	for (i__ = 2; i__ <= i__2; ++i__) {
	    t[i__ + 4] = t[i__ + 4] + qu * t[i__ - 1] - qv * t[i__ + 9];
	    t[i__ + 14] = t[i__ + 14] - qu * t[i__ + 9] - qv * t[i__ - 1];
 
	}
	for (l = 1; l <= 2; ++l) {
	    ll = l << 1;
	    alfa[l - 1] = -(t[ll + (ll - 1) * 5 - 6] * t[ll + ll * 5 - 6] + t[
		    ll + 1 + (ll - 1) * 5 - 6] * t[ll + 1 + ll * 5 - 6]);
 
	}
	if (mpe > 9 || mpe == 9 && nmz <= 1) {
	    goto L740;
	}
	if (mpe < subres_ .nta) {
	    goto L740;
	}
	if (mpe > subres_ .nte) {
	    mpe = subres_ .nte;
	}
	if (subres_ .nta > 2) {
	    goto L500;
	}
	if (mx == -1 || mx == 1 || mx == 2 || mx == 3 || mx == 4 || mx == 5 ||
		 mx == 6 || mx == 7) {
	    goto L500;
	}
 

 
 

	i__2 = nmz;
	for (l = 2; l <= i__2; ++l) {
	    l1 = l - 1;
 
	    ab2[1] += l1 * (aa[l - 1] * cr[l1 - 1] - bb[l - 1] * ci[l1 - 1]);
	}
L500:
	b1 = beta[0];
	b2 = beta[1];
	sb1 = sqrt(b1);
	sb2 = sqrt(b2);
	b[2] = b1;
	b[20] = b2;
	b[11] = sb1 * sb2;
	if (subres_ .nta > 3) {
	    goto L520;
	}
	if (mpe == 2 || mpe == 9 && nmz <= 2) {
	    goto L650;
	}
	if (mx == 1 || mx == 2 || mx == 3 || mx == 4 || mx == 5 || mx == 6 || 
		mx == 7) {
	    goto L520;
	}
 

 
 

	l2 = 1;
	i__2 = nmz;
	for (l = 3; l <= i__2; ++l) {
	    l1 = l - 2;
	    ab1[2] += l2 * (aa[l - 1] * ci[l1 - 1] + bb[l - 1] * cr[l1 - 1]);
	    ab2[2] += l2 * (aa[l - 1] * cr[l1 - 1] - bb[l - 1] * ci[l1 - 1]);
 
	    l2 = l2 * l / l1;
	}
L520:
	b[3] = b1 * sb1;
	b[30] = b2 * sb2;
	b[12] = b1 * sb2;
	b[21] = b2 * sb1;
	if (subres_ .nta > 4) {
	    goto L540;
	}
	if (mpe == 3 || mpe == 9 && nmz <= 3) {
	    goto L650;
	}
	if (mx == 2 || mx == 3 || mx == 4 || mx == 5 || mx == 6 || mx == 7) {
	    goto L540;
	}
 

 
 

	l2 = 1;
	i__2 = nmz;
	for (l = 4; l <= i__2; ++l) {
	    l1 = l - 3;
	    ab1[3] += l2 * (aa[l - 1] * ci[l1 - 1] + bb[l - 1] * cr[l1 - 1]);
	    ab2[3] += l2 * (aa[l - 1] * cr[l1 - 1] - bb[l - 1] * ci[l1 - 1]);
 
	    l2 = l2 * l / l1;
	}
L540:
	b[4] = b1 * b1;
	b[40] = b2 * b2;
	b[13] = b[12] * sb1;
	b[31] = b[21] * sb2;
	b[22] = b1 * b2;
	if (subres_ .nta > 5) {
	    goto L560;
	}
	if (mpe == 4 || mpe == 9 && nmz <= 4) {
	    goto L650;
	}
	if (mx == 3 || mx == 4 || mx == 5 || mx == 6 || mx == 7) {
	    goto L560;
	}
 

 
 

	l2 = 1;
	i__2 = nmz;
	for (l = 5; l <= i__2; ++l) {
	    l1 = l - 4;
	    ab1[4] += l2 * (aa[l - 1] * ci[l1 - 1] + bb[l - 1] * cr[l1 - 1]);
	    ab2[4] += l2 * (aa[l - 1] * cr[l1 - 1] - bb[l - 1] * ci[l1 - 1]);
 
	    l2 = l2 * l / l1;
	}
L560:
	b[5] = b[4] * sb1;
	b[50] = b[40] * sb2;
	b[14] = b[13] * sb1;
	b[41] = b[31] * sb2;
	b[23] = b[13] * sb2;
	b[32] = b[31] * sb1;
	if (subres_ .nta > 6) {
	    goto L580;
	}
	if (mpe == 5 || mpe == 9 && nmz <= 5) {
	    goto L650;
	}
	if (mx == 4 || mx == 5 || mx == 6 || mx == 7) {
	    goto L580;
	}
 

 
 

	l2 = 1;
	i__2 = nmz;
	for (l = 6; l <= i__2; ++l) {
	    l1 = l - 5;
	    ab1[5] += l2 * (aa[l - 1] * ci[l1 - 1] + bb[l - 1] * cr[l1 - 1]);
	    ab2[5] += l2 * (aa[l - 1] * cr[l1 - 1] - bb[l - 1] * ci[l1 - 1]);
 
	    l2 = l2 * l / l1;
	}
L580:
	b[6] = b[5] * sb1;
	b[60] = b[50] * sb2;
	b[15] = b[14] * sb1;
	b[51] = b[41] * sb2;
	b[24] = b[14] * sb2;
	b[42] = b[41] * sb1;
	b[33] = b[32] * sb1;
	if (subres_ .nta > 7) {
	    goto L600;
	}
	if (mpe == 6 || mpe == 9 && nmz <= 6) {
	    goto L650;
	}
	if (mx == 5 || mx == 6 || mx == 7) {
	    goto L600;
	}
 

 
 

	l2 = 1;
	i__2 = nmz;
	for (l = 7; l <= i__2; ++l) {
	    l1 = l - 6;
	    ab1[6] += l2 * (aa[l - 1] * ci[l1 - 1] + bb[l - 1] * cr[l1 - 1]);
	    ab2[6] += l2 * (aa[l - 1] * cr[l1 - 1] - bb[l - 1] * ci[l1 - 1]);
 
	    l2 = l2 * l / l1;
	}
L600:
	b[7] = b[6] * sb1;
	b[70] = b[60] * sb2;
	b[16] = b[6] * sb2;
	b[61] = b[60] * sb1;
	b[25] = b[24] * sb1;
	b[52] = b[42] * sb2;
	b[34] = b[33] * sb1;
	b[43] = b[33] * sb2;
	if (subres_ .nta > 8) {
	    goto L620;
	}
	if (mpe == 7 || mpe == 9 && nmz <= 7) {
	    goto L650;
	}
	if (mx == 6 || mx == 7) {
	    goto L620;
	}
 

 
 

	l2 = 1;
	i__2 = nmz;
	for (l = 8; l <= i__2; ++l) {
	    l1 = l - 7;
	    ab1[7] += l2 * (aa[l - 1] * ci[l1 - 1] + bb[l - 1] * cr[l1 - 1]);
	    ab2[7] += l2 * (aa[l - 1] * cr[l1 - 1] - bb[l - 1] * ci[l1 - 1]);
 
	    l2 = l2 * l / l1;
	}
L620:
	b[8] = b[7] * sb1;
	b[80] = b[70] * sb2;
	b[17] = b[7] * sb2;
	b[71] = b[70] * sb1;
	b[26] = b[16] * sb2;
	b[62] = b[61] * sb1;
	b[35] = b[25] * sb2;
	b[53] = b[52] * sb1;
	b[44] = b[43] * sb1;
	if (mpe == 8 || mpe == 9 && nmz <= 8) {
	    goto L650;
	}
	if (mx == 7) {
	    goto L640;
	}
 

 
 

	l2 = 1;
	i__2 = nmz;
	for (l = 9; l <= i__2; ++l) {
	    l1 = l - 8;
	    ab1[8] += l2 * (aa[l - 1] * ci[l1 - 1] + bb[l - 1] * cr[l1 - 1]);
	    ab2[8] += l2 * (aa[l - 1] * cr[l1 - 1] - bb[l - 1] * ci[l1 - 1]);
 
	    l2 = l2 * l / l1;
	}
L640:
	b[9] = b[8] * sb1;
	b[90] = b[80] * sb2;
	b[18] = b[8] * sb2;
	b[81] = b[80] * sb1;
	b[27] = b[17] * sb2;
	b[72] = b[71] * sb1;
	b[63] = b[62] * sb1;
	b[36] = b[26] * sb2;
	b[54] = b[53] * sb1;
	b[45] = b[35] * sb2;
 

L650:
	i__2 = mpe;
	for (np = 1; np <= i__2; ++np) {
	    n2e = np << 1;
	    i__3 = n2e;
	    for (nv = 1; nv <= i__3; ++nv) {
		n2 = nv - np;
		nn2 = (( n2 ) >= 0 ? ( n2 ) : -( n2 )) ;
		nn1 = np - nn2;
		re1 = nn1 * subres_ .qxt + n2 * subres_ .qzt;
		ip[np + nv * 10 - 11] = (integer) (re1 + .5) + subres_ .ipt;
		if (-re1 > 1e-17) {
		    ip[np + nv * 10 - 11] = -((integer) ((( re1 ) >= 0 ? ( re1 ) : -( re1 ))  + .5)) - 
			    subres_ .ipt;
		}
 
		re[np + nv * 10 - 11] = re1 - ip[np + nv * 10 - 11];
		res = re[np + nv * 10 - 11] / radi;
		chy[np + nv * 9 - 10] = cos(nn1 * phi[0] + n2 * phi[1] - res *
			 etl);
		shy[np + nv * 9 - 10] = sin(nn1 * phi[0] + n2 * phi[1] - res *
			 etl);
 
	    }
 
	}
	i__2 = mpe;
	for (np = subres_ .nta; np <= i__2; ++np) {
	    np2 = np;
	    nkk = 0;
L680:
	    ++nkk;
	    n2e = np2 << 1;
	    i__3 = nkk;
	    for (i__ = 1; i__ <= i__3; ++i__) {
		i__4 = n2e;
		for (nv = 1; nv <= i__4; ++nv) {
		    nn2 = (i__5 = nv - np2, (( i__5 ) >= 0 ? ( i__5 ) : -( i__5 )) );
		    nv1 = np2 - nn2 + (i__ - 1 << 1) + 1;
		    nv2 = np - nv1 + 2;
		    rn2 = nn2 * .5;
 
		    mm = 0;
		    gerad = rn2 - d_int(&rn2);
		    if ((( gerad ) >= 0 ? ( gerad ) : -( gerad ))  <= 1e-17) {
			mm = 1;
		    }
 
		    if (mm == 0) {
			goto L690;
		    }
		    btc = ab1[np - 1] * b[nv1 + nv2 * 10 - 11] * chy[np2 + nv 
			    * 9 - 10];
		    bts = ab1[np - 1] * b[nv1 + nv2 * 10 - 11] * shy[np2 + nv 
			    * 9 - 10];
		    goto L700;
L690:
		    btc = ab2[np - 1] * b[nv1 + nv2 * 10 - 11] * chy[np2 + nv 
			    * 9 - 10];
		    bts = ab2[np - 1] * b[nv1 + nv2 * 10 - 11] * shy[np2 + nv 
			    * 9 - 10];
L700:
		    secom_ .rtc[np2 + (nv + (np + i__ * 10) * 18) * 9 - 1792] 
			    += btc;
		    secom_ .rts[np2 + (nv + (np + i__ * 10) * 18) * 9 - 1792] 
			    += bts;
 
		}
 
	    }
	    np2 += -2;
	    if (np2 >= 1) {
		goto L680;
	    }
 
	}
L740:
	;
    }
    nnf[0] = 1;
    nnf[1] = 1;
    nnf[2] = 2;
    nz2[1] = 2;
    sea = sqrt(ep[0]);
    seb = sqrt(ep[1]);
    ea = ep[0];
    eb = ep[1];
    e[2] = 1. / eb;
    e[20] = 1. / ea;
    e[11] = 1. / seb / sea;
    nnf[3] = 6;
    nz2[2] = 4;
    e[3] = sea / eb;
    e[30] = seb / ea;
    e[12] = 1. / seb;
    e[21] = 1. / sea;
    nnf[4] = 24;
    nz2[3] = 8;
    e[4] = ea / eb;
    e[40] = eb / ea;
    e[13] = sea / seb;
    e[31] = seb / sea;
    e[22] = 1.;
    nnf[5] = 120;
    nz2[4] = 16;
    e[5] = e[4] * sea;
    e[50] = e[40] * seb;
    e[14] = ea / seb;
    e[41] = eb / sea;
    e[23] = sea;
    e[32] = seb;
    nnf[6] = 720;
    nz2[5] = 32;
    e[6] = e[5] * sea;
    e[60] = e[50] * seb;
    e[15] = e[14] * sea;
    e[51] = e[41] * seb;
    e[24] = ea;
    e[42] = eb;
    e[33] = sea * seb;
    nnf[7] = 5040;
    nz2[6] = 64;
    e[7] = e[6] * sea;
    e[70] = e[60] * seb;
    e[16] = e[15] * sea;
    e[61] = e[51] * seb;
    e[25] = ea * sea;
    e[52] = eb * seb;
    e[34] = ea * seb;
    e[43] = sea * eb;
    nnf[8] = 40320;
    nz2[7] = 128;
    e[8] = e[7] * sea;
    e[80] = e[70] * seb;
    e[17] = e[16] * sea;
    e[71] = e[61] * seb;
    e[26] = ea * ea;
    e[62] = eb * eb;
    e[35] = e[34] * sea;
    e[53] = e[43] * seb;
    e[44] = ea * eb;
    nnf[9] = 362880;
    nz2[8] = 256;
    e[9] = e[8] * sea;
    e[90] = e[80] * seb;
    e[18] = e[17] * sea;
    e[81] = e[71] * seb;
    e[27] = e[26] * sea;
    e[72] = e[62] * seb;
    e[36] = e[35] * sea;
    e[63] = e[53] * seb;
    e[45] = e[44] * sea;
    e[54] = e[44] * seb;
    i__1 = subres_ .nte;
    for (np = subres_ .nta; np <= i__1; ++np) {
	vdt1 = nnf[np - 1] / (nz2[np - 1] * kons_ .pi);
	np2 = np;
	nkk = 0;
L750:
	++nkk;
	n2e = np2 << 1;
	i__2 = nkk;
	for (i__ = 1; i__ <= i__2; ++i__) {
	    i__3 = n2e;
	    for (nv = 1; nv <= i__3; ++nv) {
		n2 = nv - np2;
		nn2 = (( n2 ) >= 0 ? ( n2 ) : -( n2 )) ;
		nn1 = np2 - nn2;
		nv1 = nn1 + (i__ - 1 << 1) + 1;
		nv2 = np - nv1 + 2;
		nv11 = nv1 - 1;
		nv21 = nv2 - 1;
		nf1 = nn1 + i__;
		nf3 = nkk - i__ + 1;
		nf4 = nf3 + nn2;
		vdt2 = vdt1 * e[nv1 + nv2 * 10 - 11] / (nnf[nf1 - 1] * nnf[
			i__ - 1] * nnf[nf3 - 1] * nnf[nf4 - 1]);
		vdt3 = nn2 * ea + nn1 * eb;
		if (n2 >= 0) {
		    vdt3 = n2 * nv21 * ea + nn1 * nv11 * eb;
		}
		secom_ .rtc[np2 + (nv + (np + i__ * 10) * 18) * 9 - 1792] = 
			secom_ .rtc[np2 + (nv + (np + i__ * 10) * 18) * 9 - 
			1792] * vdt2 * vdt3;
		secom_ .rts[np2 + (nv + (np + i__ * 10) * 18) * 9 - 1792] = 
			secom_ .rts[np2 + (nv + (np + i__ * 10) * 18) * 9 - 
			1792] * vdt2 * vdt3;
 
	    }
 
	}
	np2 += -2;
	if (np2 >= 1) {
	    goto L750;
	}
 
    }
    return 0;
}  

 
 
  int sumpos_()
{
     
    static char fmt_10000[] = "(\002 \002/131(\002-\002)/t10,\002SUMMARY OF THE POSTPROCESSING\002//t1,125(\002-\002),/t1,\002|\002,8x,\002|\002,11x,\002|\002,11x,\002|\002,12x,\002|\002,10x,\002|NORMALIZED| SLOPE  |\002,13x,\002|\002,10x,\002|\002,21x,\002|\002,/t1,\002|  TURN  |   LINEAR  |   BETA-   | AMPLITUDES | MOMENTUM |\002,\002PHASESPACE| OF THE |  NONLINEAR  |  NEAREST |\002,7x,\002SMEAR OF\002,6x,\002|\002,/t1,\002| NUMBER |   TUNES   | FUNCTIONS |            | DEVIATION|\002,\002 DISTANCE |DISTANCE|  DETUNING   | RESONANCE|    THE EMITTANCES\002,3x,\002|\002,/t1,125(\002-\002),/t1,\002|        |           |     [M]   |     [MM]   |          |\002,\002          |        |             |     |ORD.|\002,\002    [%]  |      [%]  |\002/t1,125(\002-\002))";
    static char fmt_10010[] = "(t1,\002|\002,i8,\002|X \002,f9.5,\002|X \002,f9.4,\002|X \002,f10.6,\002|\002,d10.4,\002|\002,d10.4,\002|\002,f8.4,\002|X \002,d11.5,\002|X \002,i3,\002| \002,i2,\002 |X \002,f7.3,\002|X+Z \002,f7.3,\002|\002/t1,\002|  \002,a4,\002  |Z \002,f9.5,\002|Z \002,f9.4,\002|Z \002,f10.6,\002|\002,10x,\002|\002,10x,\002|\002,8x,\002|+/- \002,d9.3,\002|Z \002,i3,\002|    |Z \002,f7.3,\002|    \002,7x,\002|\002/t1,\002|\002,8x,\002|QS \002,f8.6,\002|  \002,9x,\002|  \002,10x,\002|\002,10x,\002|\002,10x,\002|\002,8x,\002|Z \002,d11.5,\002|  \002,3x,\002|    |  \002,7x,\002|    \002,7x,\002|\002/t1,\002|\002,8x,\002|  \002,9x,\002|  \002,9x,\002|  \002,10x,\002|\002,10x,\002|\002,10x,\002|\002,8x,\002|+/- \002,d9.3,\002|  \002,3x,\002|    |  \002,7x,\002|    \002,7x,\002|\002/t1,125(\002-\002))";
    static char fmt_10020[] = "(\002 \002/131(\002-\002)/t10,\002RANDOM SETS USED\002//\002  CASE  |  # OF RANDOM SET  |  MAX. POSSIBLE SETS   |    \002,\002 SEED\002/65(\002-\002))";
    static char fmt_10030[] = "(3x,i2,13x,i2,19x,i2,13x,i8)";
    static char fmt_10040[] = "(65(\002-\002)//131(\002-\002))";

     
    integer i__1, i__2, i__3, i__4;
    alist al__1;

     
    integer f_rew();
      int s_copy();
    integer s_rsle(), do_lio(), e_rsle(), s_wsle(), e_wsle(), s_wsfe(), 
	    e_wsfe(), i_dnnt(), do_fio();

     
    static doublereal d__[60];
    static integer i__, j;
    static char ch[4];
    static integer ierro;
    static doublereal dlost;

     
    static cilist io___4154 = { 1, 10, 1, 0, 0 };
    static cilist io___4157 = { 0, 6, 0, 0, 0 };
    static cilist io___4158 = { 0, 6, 0, 0, 0 };
    static cilist io___4159 = { 0, 6, 0, fmt_10000, 0 };
    static cilist io___4161 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___4162 = { 0, 6, 0, fmt_10020, 0 };
    static cilist io___4163 = { 1, 10, 1, 0, 0 };
    static cilist io___4164 = { 0, 6, 0, 0, 0 };
    static cilist io___4165 = { 0, 6, 0, 0, 0 };
    static cilist io___4166 = { 0, 6, 0, fmt_10030, 0 };
    static cilist io___4167 = { 0, 6, 0, fmt_10040, 0 };


 

 
 

    al__1.aerr = 0;
    al__1.aunit = 10;
    f_rew(&al__1);
    for (i__ = 1; i__ <= 1000; ++i__) {
	s_copy(ch, " ", 4L, 1L);
	ierro = s_rsle(&io___4154);
	if (ierro != 0) {
	    goto L100129;
	}
	for (j = 1; j <= 60; ++j) {
	    ierro = do_lio(&c__5, &c__1, (char *)&d__[j - 1], (ftnlen)sizeof(
		    doublereal));
	    if (ierro != 0) {
		goto L100129;
	    }
	}
	ierro = e_rsle();
L100129:
	if (ierro < 0) {
	    goto L20;
	}
	if (ierro > 0) {
	    s_wsle(&io___4157);
	    do_lio(&c__9, &c__1, "**ERROR**", 9L);
	    e_wsle();
	    s_wsle(&io___4158);
	    do_lio(&c__9, &c__1, "CORRUPTED INPUT FILE FOR SUMMARY OF THE", 
		    39L);
	    do_lio(&c__9, &c__1, " POSTPROCESSING ERROR # : ", 26L);
	    do_lio(&c__3, &c__1, (char *)&ierro, (ftnlen)sizeof(integer));
	    e_wsle();
	    return 0;
	}
	if (i__ == 1) {
	    s_wsfe(&io___4159);
	    e_wsfe();
	}
	if ((( d__[1] ) >= 0 ? ( d__[1] ) : -( d__[1] ))  > 1e-17) {
	    s_copy(ch, "LOST", 4L, 4L);
	}
	if (d__[21] >= d__[22]) {
	    dlost = d__[22];
	} else {
	    dlost = d__[21];
	}
	s_wsfe(&io___4161);
	i__1 = i_dnnt(&dlost);
	do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)&d__[2], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&d__[4], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&d__[6], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&d__[8], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&d__[9], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&d__[10], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&d__[11], (ftnlen)sizeof(doublereal));
	i__2 = i_dnnt(&d__[15]);
	do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
	i__3 = i_dnnt(&d__[17]);
	do_fio(&c__1, (char *)&i__3, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)&d__[18], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&d__[20], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, ch, 4L);
	do_fio(&c__1, (char *)&d__[3], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&d__[5], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&d__[7], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&d__[12], (ftnlen)sizeof(doublereal));
	i__4 = i_dnnt(&d__[16]);
	do_fio(&c__1, (char *)&i__4, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)&d__[19], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&d__[24], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&d__[13], (ftnlen)sizeof(doublereal));
	do_fio(&c__1, (char *)&d__[14], (ftnlen)sizeof(doublereal));
	e_wsfe();
 
    }
L20:
    al__1.aerr = 0;
    al__1.aunit = 10;
    f_rew(&al__1);
    s_wsfe(&io___4162);
    e_wsfe();
    for (i__ = 1; i__ <= 1000; ++i__) {
	ierro = s_rsle(&io___4163);
	if (ierro != 0) {
	    goto L100130;
	}
	for (j = 1; j <= 60; ++j) {
	    ierro = do_lio(&c__5, &c__1, (char *)&d__[j - 1], (ftnlen)sizeof(
		    doublereal));
	    if (ierro != 0) {
		goto L100130;
	    }
	}
	ierro = e_rsle();
L100130:
	if (ierro < 0) {
	    goto L40;
	}
	if (ierro > 0) {
	    s_wsle(&io___4164);
	    do_lio(&c__9, &c__1, "**ERROR**", 9L);
	    e_wsle();
	    s_wsle(&io___4165);
	    do_lio(&c__9, &c__1, "CORRUPTED INPUT FILE FOR SUMMARY OF THE", 
		    39L);
	    do_lio(&c__9, &c__1, " POSTPROCESSING ERROR # : ", 26L);
	    do_lio(&c__3, &c__1, (char *)&ierro, (ftnlen)sizeof(integer));
	    e_wsle();
	    return 0;
	}
	s_wsfe(&io___4166);
	do_fio(&c__1, (char *)&i__, (ftnlen)sizeof(integer));
	i__1 = i_dnnt(&d__[59]);
	do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer));
	i__2 = i_dnnt(&d__[58]);
	do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
	i__3 = i_dnnt(&d__[59]) * i_dnnt(&d__[23]);
	do_fio(&c__1, (char *)&i__3, (ftnlen)sizeof(integer));
	e_wsfe();
 
    }
L40:
    s_wsfe(&io___4167);
    e_wsfe();
 

    return 0;
}  

 
 
  int synoda_()
{
     

    static integer lfox0 = 0;

     
    doublereal d__1;

     
    static integer ix, idaa;
    extern   int dakey_(), dacmu_(), dacdi_(), dacad_(), 
	    dafun_(), daadd_(), dacop_(), damul_(), dacsu_();

 

 
 
 

 

 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
    if (lfox0 == 0) {
	lfox0 = 1;
	dakey_("FOX V2.1", 8L);
    }
    idaa = dascr_ .idao;
 
 

    ix = syn_ .ixcav;
    if (ell_ .kz[ix - 1] == 12) {
 

 
	dascr_ .rscrri[idaa] = syn_ .hsyc[ix - 1];
	dascr_ .iscrri[idaa + 1] = syn_ .itionc[ix - 1];
	dascr_ .rscrri[idaa + 2] = syn_ .phasc[ix - 1];
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dacmu_(& daele_ .sigmda, &d__1, & dascr_ .iscrda[idaa + 3]);
	dacdi_(& dascr_ .iscrda[idaa + 3], &c_b2384, & dascr_ .iscrda[idaa + 4])
		;
	d__1 = dascr_ .iscrri[idaa + 1] * 1.;
	dacmu_(& dascr_ .iscrda[idaa + 4], &d__1, & dascr_ .iscrda[idaa + 5]);
	d__1 = dascr_ .rscrri[idaa + 2] * 1.;
	dacad_(& dascr_ .iscrda[idaa + 5], &d__1, & dascr_ .iscrda[idaa + 6]);
	dascr_ .rscrri[idaa + 7] = ell_ .ed[ix - 1];
	dafun_("SIN   ", & dascr_ .iscrda[idaa + 6], & dascr_ .iscrda[idaa + 8],
		 6L);
	d__1 = dascr_ .rscrri[idaa + 7] * 1.;
	dacmu_(& dascr_ .iscrda[idaa + 8], &d__1, & dascr_ .iscrda[idaa + 9]);
	daadd_(& daele_ .ej1, & dascr_ .iscrda[idaa + 9], & dascr_ .iscrda[idaa 
		+ 10]);
	dacop_(& dascr_ .iscrda[idaa + 10], & daele_ .ej1);
    } else {
 

	dascr_ .rscrri[idaa] = syn_ .hsy[2];
	d__1 = dascr_ .rscrri[idaa] * 1.;
	dacmu_(& daele_ .sigmda, &d__1, & dascr_ .iscrda[idaa + 1]);
	dacdi_(& dascr_ .iscrda[idaa + 1], &c_b2384, & dascr_ .iscrda[idaa + 2])
		;
	d__1 = syn_ .ition * 1.;
	dacmu_(& dascr_ .iscrda[idaa + 2], &d__1, & dascr_ .iscrda[idaa + 3]);
	d__1 = syn_ .phas * 1.;
	dacad_(& dascr_ .iscrda[idaa + 3], &d__1, & dascr_ .iscrda[idaa + 4]);
	dascr_ .rscrri[idaa + 5] = syn_ .hsy[0];
	dafun_("SIN   ", & dascr_ .iscrda[idaa + 4], & dascr_ .iscrda[idaa + 6],
		 6L);
	d__1 = dascr_ .rscrri[idaa + 5] * 1.;
	dacmu_(& dascr_ .iscrda[idaa + 6], &d__1, & dascr_ .iscrda[idaa + 7]);
	daadd_(& daele_ .ej1, & dascr_ .iscrda[idaa + 7], & dascr_ .iscrda[idaa 
		+ 8]);
	dacop_(& dascr_ .iscrda[idaa + 8], & daele_ .ej1);
    }
 

    damul_(& daele_ .ej1, & daele_ .ej1, & dascr_ .iscrda[idaa]);
    dascr_ .rscrri[idaa + 1] = syn_ .pma * syn_ .pma;
    d__1 = dascr_ .rscrri[idaa + 1] * 1.;
    dacsu_(& dascr_ .iscrda[idaa], &d__1, & dascr_ .iscrda[idaa + 2]);
    dafun_("SQRT  ", & dascr_ .iscrda[idaa + 2], & dascr_ .iscrda[idaa + 3], 6L)
	    ;
    dacop_(& dascr_ .iscrda[idaa + 3], & daele_ .ejf1);
 

    d__1 = main4_ .e0f * 1.;
    dacsu_(& daele_ .ejf1, &d__1, & dascr_ .iscrda[idaa]);
    d__1 = main4_ .e0f * 1.;
    dacdi_(& dascr_ .iscrda[idaa], &d__1, & dascr_ .iscrda[idaa + 1]);
    dacmu_(& dascr_ .iscrda[idaa + 1], &c_b2384, & dascr_ .iscrda[idaa + 2]);
    dacop_(& dascr_ .iscrda[idaa + 2], & daele_ .dpda1);
    return 0;
}  

 
 
  int synuthck_()
{
     
    integer i__1, i__2;
    doublereal d__1;

     
    double sqrt(), tan(), sin(), cos(), exp();

     
    static integer j, l, ih1, ih2, kz1;
    static doublereal fokm;

 


 


 
 

 
 

 
    i__1 = tra1_ .napx;
    for (j = 1; j <= i__1; ++j) {
	main2_ .dpd[j - 1] = main1_ .dpsv[j - 1] + 1.;
	main2_ .dpsq[j - 1] = sqrt(main2_ .dpd[j - 1]);
 
    }
    i__1 = str_ .il;
    for (l = 1; l <= i__1; ++l) {
	if ((d__1 = ell_ .el[l - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    goto L160;
	}
	kz1 = ell_ .kz[l - 1] + 1;
	switch ((int)kz1) {
	    case 1:  goto L20;
	    case 2:  goto L40;
	    case 3:  goto L80;
	    case 4:  goto L60;
	    case 5:  goto L40;
	    case 6:  goto L60;
	    case 7:  goto L100;
	    case 8:  goto L100;
	    case 9:  goto L140;
	}
 

 
 

L20:
	i__2 = tra1_ .napx;
	for (j = 1; j <= i__2; ++j) {
	    syos_ .as[((j + (l << 6) << 1) + 1) * 6 - 781] = - main1_ .rvv[j - 
		    1] * ell_ .el[l - 1] / 2e3;
	    syos_ .as[((j + (l << 6) << 1) + 2) * 6 - 781] = syos_ .as[((j + (
		    l << 6) << 1) + 1) * 6 - 781];
	    syos_ .as[((j + (l << 6) << 1) + 1) * 6 - 786] = ell_ .el[l - 1] *
		     (1. - main1_ .rvv[j - 1]) * 1e3;
 
	}
	goto L160;
 

 
 
 

L40:
	fokm = ell_ .el[l - 1] * ell_ .ed[l - 1];
	if ((( fokm ) >= 0 ? ( fokm ) : -( fokm ))  <= 1e-17) {
	    goto L20;
	}
	if (kz1 == 2) {
	    ih1 = 1;
	    ih2 = 2;
	} else {
 
	    ih1 = 2;
	    ih2 = 1;
	}
	i__2 = tra1_ .napx;
	for (j = 1; j <= i__2; ++j) {
	    main2_ .fok[j - 1] = fokm / main2_ .dpsq[j - 1];
	    main2_ .rho[j - 1] = 1. / ell_ .ed[l - 1] * main2_ .dpsq[j - 1];
	    main2_ .fok1[j - 1] = tan(main2_ .fok[j - 1] * .5) / main2_ .rho[
		    j - 1];
	    main2_ .si[j - 1] = sin(main2_ .fok[j - 1]);
	    main2_ .co[j - 1] = cos(main2_ .fok[j - 1]);
	    syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 785] = main2_ .rho[j 
		    - 1] * main2_ .si[j - 1];
	    syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 782] = - main1_ .dpsv[
		    j - 1] * (main2_ .rho[j - 1] * (1. - main2_ .co[j - 1]) / 
		    main2_ .dpsq[j - 1]) * 1e3;
	    syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 781] = - main1_ .dpsv[
		    j - 1] * (tan(main2_ .fok[j - 1] * .5) * 2. / 
		    main2_ .dpsq[j - 1]) * 1e3;
	    main2_ .sm1[j - 1] = cos(main2_ .fok[j - 1]);
	    main2_ .sm2[j - 1] = sin(main2_ .fok[j - 1]) * main2_ .rho[j - 1];
	    main2_ .sm3[j - 1] = -sin(main2_ .fok[j - 1]) / main2_ .rho[j - 1]
		    ;
	    main2_ .sm12[j - 1] = ell_ .el[l - 1] - main2_ .sm1[j - 1] * 
		    main2_ .sm2[j - 1];
	    main2_ .sm23[j - 1] = main2_ .sm2[j - 1] * main2_ .sm3[j - 1];
	    main2_ .as3[j - 1] = - main1_ .rvv[j - 1] * (main1_ .dpsv[j - 1] * 
		    main2_ .rho[j - 1] / (main2_ .dpsq[j - 1] * 2.) * 
		    main2_ .sm23[j - 1] - main2_ .rho[j - 1] * main2_ .dpsq[j 
		    - 1] * (1. - main2_ .sm1[j - 1]));
	    main2_ .as4[j - 1] = - main1_ .rvv[j - 1] * main2_ .sm23[j - 1] / 
		    2e3;
	    main2_ .as6[j - 1] = - main1_ .rvv[j - 1] * (ell_ .el[l - 1] + 
		    main2_ .sm1[j - 1] * main2_ .sm2[j - 1]) / 4e3;
	    syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 786] = (- main1_ .rvv[
		    j - 1] * (main1_ .dpsv[j - 1] * main1_ .dpsv[j - 1] / (
		    main2_ .dpd[j - 1] * 4.) * main2_ .sm12[j - 1] + 
		    main1_ .dpsv[j - 1] * (ell_ .el[l - 1] - main2_ .sm2[j - 
		    1])) + ell_ .el[l - 1] * (1. - main1_ .rvv[j - 1])) * 1e3;
	    syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 785] = - main1_ .rvv[j 
		    - 1] * (main1_ .dpsv[j - 1] / (main2_ .rho[j - 1] * 2. * 
		    main2_ .dpsq[j - 1]) * main2_ .sm12[j - 1] - main2_ .sm2[
		    j - 1] * main2_ .dpsq[j - 1] / main2_ .rho[j - 1]) + 
		    main2_ .fok1[j - 1] * main2_ .as3[j - 1];
	    syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 784] = main2_ .as3[j 
		    - 1];
	    syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 783] = main2_ .as4[j 
		    - 1] + main2_ .as6[j - 1] * 2. * main2_ .fok1[j - 1];
	    syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 782] = - main1_ .rvv[j 
		    - 1] * main2_ .sm12[j - 1] / (main2_ .rho[j - 1] * 4e3 * 
		    main2_ .rho[j - 1]) + main2_ .as6[j - 1] * main2_ .fok1[j 
		    - 1] * main2_ .fok1[j - 1] + main2_ .fok1[j - 1] * 
		    main2_ .as4[j - 1];
	    syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 781] = main2_ .as6[j 
		    - 1];
 
	    main2_ .g[j - 1] = tan(main2_ .fok[j - 1] * .5) / main2_ .rho[j - 
		    1];
	    main2_ .gl[j - 1] = ell_ .el[l - 1] * main2_ .g[j - 1];
	    syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 786] = 1. - 
		    main2_ .gl[j - 1];
	    syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 784] = - main2_ .g[j - 
		    1] * (2. - main2_ .gl[j - 1]);
	    syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 783] = syos_ .al[(ih2 
		    + (j + (l << 6) << 1)) * 6 - 786];
	    main2_ .as6[j - 1] = - main1_ .rvv[j - 1] * syos_ .al[(ih2 + (j + (
		    l << 6) << 1)) * 6 - 785] / 2e3;
	    syos_ .as[(ih2 + (j + (l << 6) << 1)) * 6 - 783] = main2_ .as6[j 
		    - 1] * -2. * main2_ .fok1[j - 1];
	    syos_ .as[(ih2 + (j + (l << 6) << 1)) * 6 - 782] = main2_ .as6[j 
		    - 1] * main2_ .fok1[j - 1] * main2_ .fok1[j - 1];
	    syos_ .as[(ih2 + (j + (l << 6) << 1)) * 6 - 781] = main2_ .as6[j 
		    - 1];
 
	}
	goto L160;
 

 
 
 

L60:
	fokm = ell_ .el[l - 1] * ell_ .ed[l - 1];
	if ((( fokm ) >= 0 ? ( fokm ) : -( fokm ))  <= 1e-17) {
	    goto L20;
	}
	if (kz1 == 4) {
	    ih1 = 1;
	    ih2 = 2;
	} else {
 
	    ih1 = 2;
	    ih2 = 1;
	}
	i__2 = tra1_ .napx;
	for (j = 1; j <= i__2; ++j) {
	    main2_ .fok[j - 1] = fokm / main2_ .dpsq[j - 1];
	    main2_ .rho[j - 1] = 1. / ell_ .ed[l - 1] * main2_ .dpsq[j - 1];
	    main2_ .si[j - 1] = sin(main2_ .fok[j - 1]);
	    main2_ .co[j - 1] = cos(main2_ .fok[j - 1]);
	    main2_ .rhoc[j - 1] = main2_ .rho[j - 1] * (1. - main2_ .co[j - 1]
		    ) / main2_ .dpsq[j - 1];
	    main2_ .siq[j - 1] = main2_ .si[j - 1] / main2_ .dpsq[j - 1];
	    syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 786] = main2_ .co[j - 
		    1];
	    syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 785] = main2_ .rho[j 
		    - 1] * main2_ .si[j - 1];
	    syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 784] = - main2_ .si[j 
		    - 1] / main2_ .rho[j - 1];
	    syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 783] = main2_ .co[j - 
		    1];
	    syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 782] = - main1_ .dpsv[
		    j - 1] * main2_ .rhoc[j - 1] * 1e3;
	    syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 781] = - main1_ .dpsv[
		    j - 1] * main2_ .siq[j - 1] * 1e3;
	    main2_ .sm12[j - 1] = ell_ .el[l - 1] - syos_ .al[(ih1 + (j + (l 
		    << 6) << 1)) * 6 - 786] * syos_ .al[(ih1 + (j + (l << 6) 
		    << 1)) * 6 - 785];
	    main2_ .sm23[j - 1] = syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 
		    785] * syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 784];
	    syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 786] = (- main1_ .rvv[
		    j - 1] * (main1_ .dpsv[j - 1] * main1_ .dpsv[j - 1] / (
		    main2_ .dpd[j - 1] * 4.) * main2_ .sm12[j - 1] + 
		    main1_ .dpsv[j - 1] * (ell_ .el[l - 1] - syos_ .al[(ih1 + 
		    (j + (l << 6) << 1)) * 6 - 785])) + ell_ .el[l - 1] * (1. 
		    - main1_ .rvv[j - 1])) * 1e3;
	    syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 785] = - main1_ .rvv[j 
		    - 1] * (main1_ .dpsv[j - 1] / (main2_ .rho[j - 1] * 2. * 
		    main2_ .dpsq[j - 1]) * main2_ .sm12[j - 1] - main2_ .dpd[
		    j - 1] * main2_ .siq[j - 1]);
	    syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 784] = - main1_ .rvv[j 
		    - 1] * (main1_ .dpsv[j - 1] * main2_ .rho[j - 1] / (
		    main2_ .dpsq[j - 1] * 2.) * main2_ .sm23[j - 1] - 
		    main2_ .dpd[j - 1] * main2_ .rhoc[j - 1]);
	    syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 783] = - main1_ .rvv[j 
		    - 1] * main2_ .sm23[j - 1] / 2e3;
	    syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 782] = - main1_ .rvv[j 
		    - 1] * main2_ .sm12[j - 1] / (main2_ .rho[j - 1] * 4e3 * 
		    main2_ .rho[j - 1]);
	    syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 781] = - main1_ .rvv[j 
		    - 1] * (ell_ .el[l - 1] + syos_ .al[(ih1 + (j + (l << 6) 
		    << 1)) * 6 - 786] * syos_ .al[(ih1 + (j + (l << 6) << 1)) 
		    * 6 - 785]) / 4e3;
 
	    syos_ .as[(ih2 + (j + (l << 6) << 1)) * 6 - 781] = - main1_ .rvv[j 
		    - 1] * syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 785] / 
		    2e3;
 
	}
	goto L160;
 

 
 
 

L80:
	i__2 = tra1_ .napx;
	for (j = 1; j <= i__2; ++j) {
	    main2_ .fok[j - 1] = main1_ .ekv[j + (l << 6) - 65] * 
		    main2_ .oidpsv[j - 1];
	    main2_ .aek[j - 1] = (d__1 = main2_ .fok[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
	    main2_ .hi[j - 1] = sqrt(main2_ .aek[j - 1]);
	    main2_ .fi[j - 1] = ell_ .el[l - 1] * main2_ .hi[j - 1];
	    if (main2_ .fok[j - 1] <= 0.) {
		syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 786] = cos(
			main2_ .fi[j - 1]);
		main2_ .hi1[j - 1] = sin(main2_ .fi[j - 1]);
		if ((d__1 = main2_ .hi[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
		    syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 785] = ell_ .el[
			    l - 1];
		} else {
		    syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 785] = 
			    main2_ .hi1[j - 1] / main2_ .hi[j - 1];
		}
		syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 784] = - main2_ .hi1[
			j - 1] * main2_ .hi[j - 1];
		syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 783] = syos_ .al[((
			j + (l << 6) << 1) + 1) * 6 - 786];
		syos_ .as[((j + (l << 6) << 1) + 1) * 6 - 786] = ell_ .el[l - 
			1] * (1. - main1_ .rvv[j - 1]) * 1e3;
		syos_ .as[((j + (l << 6) << 1) + 1) * 6 - 783] = - main1_ .rvv[
			j - 1] * syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 
			785] * syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 784] 
			/ 2e3;
		syos_ .as[((j + (l << 6) << 1) + 1) * 6 - 782] = - main1_ .rvv[
			j - 1] * (ell_ .el[l - 1] - syos_ .al[((j + (l << 6) 
			<< 1) + 1) * 6 - 786] * syos_ .al[((j + (l << 6) << 1)
			 + 1) * 6 - 785]) * main2_ .aek[j - 1] / 4e3;
		syos_ .as[((j + (l << 6) << 1) + 1) * 6 - 781] = - main1_ .rvv[
			j - 1] * (ell_ .el[l - 1] + syos_ .al[((j + (l << 6) 
			<< 1) + 1) * 6 - 786] * syos_ .al[((j + (l << 6) << 1)
			 + 1) * 6 - 785]) / 4e3;
 
		main2_ .hp[j - 1] = exp(main2_ .fi[j - 1]);
		main2_ .hm[j - 1] = 1. / main2_ .hp[j - 1];
		main2_ .hc[j - 1] = (main2_ .hp[j - 1] + main2_ .hm[j - 1]) * 
			.5;
		main2_ .hs[j - 1] = (main2_ .hp[j - 1] - main2_ .hm[j - 1]) * 
			.5;
		syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 786] = main2_ .hc[j 
			- 1];
		if ((d__1 = main2_ .hi[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
		    syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 785] = ell_ .el[
			    l - 1];
		} else {
		    syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 785] = 
			    main2_ .hs[j - 1] / main2_ .hi[j - 1];
		}
		syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 784] = main2_ .hs[j 
			- 1] * main2_ .hi[j - 1];
		syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 783] = main2_ .hc[j 
			- 1];
		syos_ .as[((j + (l << 6) << 1) + 2) * 6 - 783] = - main1_ .rvv[
			j - 1] * syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 
			785] * syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 784] 
			/ 2e3;
		syos_ .as[((j + (l << 6) << 1) + 2) * 6 - 782] = main1_ .rvv[
			j - 1] * (ell_ .el[l - 1] - syos_ .al[((j + (l << 6) 
			<< 1) + 2) * 6 - 786] * syos_ .al[((j + (l << 6) << 1)
			 + 2) * 6 - 785]) * main2_ .aek[j - 1] / 4e3;
		syos_ .as[((j + (l << 6) << 1) + 2) * 6 - 781] = - main1_ .rvv[
			j - 1] * (ell_ .el[l - 1] + syos_ .al[((j + (l << 6) 
			<< 1) + 2) * 6 - 786] * syos_ .al[((j + (l << 6) << 1)
			 + 2) * 6 - 785]) / 4e3;
	    } else {
		syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 786] = cos(
			main2_ .fi[j - 1]);
		main2_ .hi1[j - 1] = sin(main2_ .fi[j - 1]);
		if ((d__1 = main2_ .hi[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
		    syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 785] = ell_ .el[
			    l - 1];
		} else {
		    syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 785] = 
			    main2_ .hi1[j - 1] / main2_ .hi[j - 1];
		}
		syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 784] = - main2_ .hi1[
			j - 1] * main2_ .hi[j - 1];
		syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 783] = syos_ .al[((
			j + (l << 6) << 1) + 2) * 6 - 786];
		syos_ .as[((j + (l << 6) << 1) + 2) * 6 - 786] = ell_ .el[l - 
			1] * (1. - main1_ .rvv[j - 1]) * 1e3;
		syos_ .as[((j + (l << 6) << 1) + 2) * 6 - 783] = - main1_ .rvv[
			j - 1] * syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 
			785] * syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 784] 
			/ 2e3;
		syos_ .as[((j + (l << 6) << 1) + 2) * 6 - 782] = - main1_ .rvv[
			j - 1] * (ell_ .el[l - 1] - syos_ .al[((j + (l << 6) 
			<< 1) + 2) * 6 - 786] * syos_ .al[((j + (l << 6) << 1)
			 + 2) * 6 - 785]) * main2_ .aek[j - 1] / 4e3;
		syos_ .as[((j + (l << 6) << 1) + 2) * 6 - 781] = - main1_ .rvv[
			j - 1] * (ell_ .el[l - 1] + syos_ .al[((j + (l << 6) 
			<< 1) + 2) * 6 - 786] * syos_ .al[((j + (l << 6) << 1)
			 + 2) * 6 - 785]) / 4e3;
 
		main2_ .hp[j - 1] = exp(main2_ .fi[j - 1]);
		main2_ .hm[j - 1] = 1. / main2_ .hp[j - 1];
		main2_ .hc[j - 1] = (main2_ .hp[j - 1] + main2_ .hm[j - 1]) * 
			.5;
		main2_ .hs[j - 1] = (main2_ .hp[j - 1] - main2_ .hm[j - 1]) * 
			.5;
		syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 786] = main2_ .hc[j 
			- 1];
		if ((d__1 = main2_ .hi[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
		    syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 785] = ell_ .el[
			    l - 1];
		} else {
		    syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 785] = 
			    main2_ .hs[j - 1] / main2_ .hi[j - 1];
		}
		syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 784] = main2_ .hs[j 
			- 1] * main2_ .hi[j - 1];
		syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 783] = main2_ .hc[j 
			- 1];
		syos_ .as[((j + (l << 6) << 1) + 1) * 6 - 783] = - main1_ .rvv[
			j - 1] * syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 
			785] * syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 784] 
			/ 2e3;
		syos_ .as[((j + (l << 6) << 1) + 1) * 6 - 782] = main1_ .rvv[
			j - 1] * (ell_ .el[l - 1] - syos_ .al[((j + (l << 6) 
			<< 1) + 1) * 6 - 786] * syos_ .al[((j + (l << 6) << 1)
			 + 1) * 6 - 785]) * main2_ .aek[j - 1] / 4e3;
		syos_ .as[((j + (l << 6) << 1) + 1) * 6 - 781] = - main1_ .rvv[
			j - 1] * (ell_ .el[l - 1] + syos_ .al[((j + (l << 6) 
			<< 1) + 1) * 6 - 786] * syos_ .al[((j + (l << 6) << 1)
			 + 1) * 6 - 785]) / 4e3;
	    }
 
	}
	goto L160;
 

 
 
 

L100:
	if (kz1 == 7) {
	    i__2 = tra1_ .napx;
	    for (j = 1; j <= i__2; ++j) {
		main1_ .fokqv[j - 1] = main1_ .ekv[j + (l << 6) - 65];
 
	    }
	    ih1 = 1;
	    ih2 = 2;
	} else {
 
	    i__2 = tra1_ .napx;
	    for (j = 1; j <= i__2; ++j) {
		main1_ .fokqv[j - 1] = - main1_ .ekv[j + (l << 6) - 65];
 
	    }
	    ih1 = 2;
	    ih2 = 1;
	}
	i__2 = tra1_ .napx;
	for (j = 1; j <= i__2; ++j) {
	    main2_ .wf[j - 1] = ell_ .ed[l - 1] / main2_ .dpsq[j - 1];
	    main2_ .fok[j - 1] = main1_ .fokqv[j - 1] / main2_ .dpd[j - 1] - 
		    main2_ .wf[j - 1] * main2_ .wf[j - 1];
	    main2_ .afok[j - 1] = (d__1 = main2_ .fok[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
	    main2_ .hi[j - 1] = sqrt(main2_ .afok[j - 1]);
	    main2_ .fi[j - 1] = main2_ .hi[j - 1] * ell_ .el[l - 1];
	    if (main2_ .afok[j - 1] <= 1e-17) {
		syos_ .as[((j + (l << 6) << 1) + 1) * 6 - 781] = - main1_ .rvv[
			j - 1] * ell_ .el[l - 1] / 2e3;
		syos_ .as[((j + (l << 6) << 1) + 2) * 6 - 781] = syos_ .as[((
			j + (l << 6) << 1) + 1) * 6 - 781];
		syos_ .as[((j + (l << 6) << 1) + 1) * 6 - 786] = ell_ .el[l - 
			1] * (1. - main1_ .rvv[j - 1]) * 1e3;
	    }
	    if (main2_ .fok[j - 1] < -1e-17) {
		main2_ .si[j - 1] = sin(main2_ .fi[j - 1]);
		main2_ .co[j - 1] = cos(main2_ .fi[j - 1]);
		main2_ .wfa[j - 1] = main2_ .wf[j - 1] / main2_ .afok[j - 1] *
			 (1. - main2_ .co[j - 1]) / main2_ .dpsq[j - 1];
		main2_ .wfhi[j - 1] = main2_ .wf[j - 1] / main2_ .hi[j - 1] * 
			main2_ .si[j - 1] / main2_ .dpsq[j - 1];
		syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 786] = main2_ .co[
			j - 1];
		syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 785] = main2_ .si[
			j - 1] / main2_ .hi[j - 1];
		syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 784] = 
			- main2_ .si[j - 1] * main2_ .hi[j - 1];
		syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 783] = main2_ .co[
			j - 1];
		syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 782] = 
			- main2_ .wfa[j - 1] * main1_ .dpsv[j - 1] * 1e3;
		syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 781] = 
			- main2_ .wfhi[j - 1] * main1_ .dpsv[j - 1] * 1e3;
		main2_ .sm12[j - 1] = ell_ .el[l - 1] - syos_ .al[(ih1 + (j + 
			(l << 6) << 1)) * 6 - 786] * syos_ .al[(ih1 + (j + (l 
			<< 6) << 1)) * 6 - 785];
		main2_ .sm23[j - 1] = syos_ .al[(ih1 + (j + (l << 6) << 1)) * 
			6 - 785] * syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 
			- 784];
		syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 786] = (
			- main1_ .rvv[j - 1] * (main1_ .dpsv[j - 1] * 
			main1_ .dpsv[j - 1] / (main2_ .dpd[j - 1] * 4.) * 
			main2_ .sm12[j - 1] + main1_ .dpsv[j - 1] * (ell_ .el[
			l - 1] - syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 
			785])) / main2_ .afok[j - 1] * main2_ .wf[j - 1] * 
			main2_ .wf[j - 1] + ell_ .el[l - 1] * (1. - 
			main1_ .rvv[j - 1])) * 1e3;
		syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 785] = 
			- main1_ .rvv[j - 1] * (main1_ .dpsv[j - 1] * 
			main2_ .wf[j - 1] / (main2_ .dpsq[j - 1] * 2.) * 
			main2_ .sm12[j - 1] - main2_ .dpd[j - 1] * 
			main2_ .wfhi[j - 1]);
		syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 784] = 
			- main1_ .rvv[j - 1] * (main1_ .dpsv[j - 1] * .5 / 
			main2_ .afok[j - 1] / main2_ .dpd[j - 1] * ell_ .ed[l 
			- 1] * main2_ .sm23[j - 1] - main2_ .dpd[j - 1] * 
			main2_ .wfa[j - 1]);
		syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 783] = 
			- main1_ .rvv[j - 1] * main2_ .sm23[j - 1] / 2e3;
		syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 782] = 
			- main1_ .rvv[j - 1] * main2_ .sm12[j - 1] * 
			main2_ .afok[j - 1] / 4e3;
		syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 781] = 
			- main1_ .rvv[j - 1] * (ell_ .el[l - 1] + syos_ .al[(
			ih1 + (j + (l << 6) << 1)) * 6 - 786] * syos_ .al[(
			ih1 + (j + (l << 6) << 1)) * 6 - 785]) / 4e3;
		main2_ .aek[j - 1] = (d__1 = main1_ .ekv[j + (l << 6) - 65] / 
			main2_ .dpd[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
		main2_ .hi[j - 1] = sqrt(main2_ .aek[j - 1]);
		main2_ .fi[j - 1] = main2_ .hi[j - 1] * ell_ .el[l - 1];
		main2_ .hp[j - 1] = exp(main2_ .fi[j - 1]);
		main2_ .hm[j - 1] = 1. / main2_ .hp[j - 1];
		main2_ .hc[j - 1] = (main2_ .hp[j - 1] + main2_ .hm[j - 1]) * 
			.5;
		main2_ .hs[j - 1] = (main2_ .hp[j - 1] - main2_ .hm[j - 1]) * 
			.5;
		syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 786] = main2_ .hc[
			j - 1];
		if ((d__1 = main2_ .hi[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		    syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 785] = 
			    main2_ .hs[j - 1] / main2_ .hi[j - 1];
		}
		syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 784] = main2_ .hs[
			j - 1] * main2_ .hi[j - 1];
		syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 783] = main2_ .hc[
			j - 1];
		syos_ .as[(ih2 + (j + (l << 6) << 1)) * 6 - 783] = 
			- main1_ .rvv[j - 1] * syos_ .al[(ih2 + (j + (l << 6) 
			<< 1)) * 6 - 785] * syos_ .al[(ih2 + (j + (l << 6) << 
			1)) * 6 - 784] / 2e3;
		syos_ .as[(ih2 + (j + (l << 6) << 1)) * 6 - 782] = 
			main1_ .rvv[j - 1] * (ell_ .el[l - 1] - syos_ .al[(
			ih2 + (j + (l << 6) << 1)) * 6 - 786] * syos_ .al[(
			ih2 + (j + (l << 6) << 1)) * 6 - 785]) * main2_ .aek[
			j - 1] / 4e3;
		syos_ .as[(ih2 + (j + (l << 6) << 1)) * 6 - 781] = 
			- main1_ .rvv[j - 1] * (ell_ .el[l - 1] + syos_ .al[(
			ih2 + (j + (l << 6) << 1)) * 6 - 786] * syos_ .al[(
			ih2 + (j + (l << 6) << 1)) * 6 - 785]) / 4e3;
	    }
 
	    if (main2_ .fok[j - 1] > 1e-17) {
		main2_ .hp[j - 1] = exp(main2_ .fi[j - 1]);
		main2_ .hm[j - 1] = 1. / main2_ .hp[j - 1];
		main2_ .hc[j - 1] = (main2_ .hp[j - 1] + main2_ .hm[j - 1]) * 
			.5;
		main2_ .hs[j - 1] = (main2_ .hp[j - 1] - main2_ .hm[j - 1]) * 
			.5;
		syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 786] = main2_ .hc[
			j - 1];
		syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 785] = main2_ .hs[
			j - 1] / main2_ .hi[j - 1];
		syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 784] = main2_ .hs[
			j - 1] * main2_ .hi[j - 1];
		syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 783] = main2_ .hc[
			j - 1];
		main2_ .wfa[j - 1] = main2_ .wf[j - 1] / main2_ .afok[j - 1] *
			 (1. - main2_ .hc[j - 1]) / main2_ .dpsq[j - 1];
		main2_ .wfhi[j - 1] = main2_ .wf[j - 1] / main2_ .hi[j - 1] * 
			main2_ .hs[j - 1] / main2_ .dpsq[j - 1];
		syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 782] = 
			main2_ .wfa[j - 1] * main1_ .dpsv[j - 1] * 1e3;
		syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 781] = 
			- main2_ .wfhi[j - 1] * main1_ .dpsv[j - 1] * 1e3;
		main2_ .sm12[j - 1] = ell_ .el[l - 1] - syos_ .al[(ih1 + (j + 
			(l << 6) << 1)) * 6 - 786] * syos_ .al[(ih1 + (j + (l 
			<< 6) << 1)) * 6 - 785];
		main2_ .sm23[j - 1] = syos_ .al[(ih1 + (j + (l << 6) << 1)) * 
			6 - 785] * syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 
			- 784];
		syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 786] = (
			main1_ .rvv[j - 1] * (main1_ .dpsv[j - 1] * 
			main1_ .dpsv[j - 1] / (main2_ .dpd[j - 1] * 4.) * 
			main2_ .sm12[j - 1] + main1_ .dpsv[j - 1] * (ell_ .el[
			l - 1] - syos_ .al[(ih1 + (j + (l << 6) << 1)) * 6 - 
			785])) / main2_ .afok[j - 1] * main2_ .wf[j - 1] * 
			main2_ .wf[j - 1] + ell_ .el[l - 1] * (1. - 
			main1_ .rvv[j - 1])) * 1e3;
		syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 785] = 
			- main1_ .rvv[j - 1] * (main1_ .dpsv[j - 1] * 
			main2_ .wf[j - 1] / (main2_ .dpsq[j - 1] * 2.) * 
			main2_ .sm12[j - 1] - main2_ .dpd[j - 1] * 
			main2_ .wfhi[j - 1]);
		syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 784] = 
			main1_ .rvv[j - 1] * (main1_ .dpsv[j - 1] * .5 / 
			main2_ .afok[j - 1] / main2_ .dpd[j - 1] * ell_ .ed[l 
			- 1] * main2_ .sm23[j - 1] - main2_ .dpd[j - 1] * 
			main2_ .wfa[j - 1]);
		syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 783] = 
			- main1_ .rvv[j - 1] * main2_ .sm23[j - 1] / 2e3;
		syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 782] = 
			main1_ .rvv[j - 1] * main2_ .sm12[j - 1] * 
			main2_ .afok[j - 1] / 4e3;
		syos_ .as[(ih1 + (j + (l << 6) << 1)) * 6 - 781] = 
			- main1_ .rvv[j - 1] * (ell_ .el[l - 1] + syos_ .al[(
			ih1 + (j + (l << 6) << 1)) * 6 - 786] * syos_ .al[(
			ih1 + (j + (l << 6) << 1)) * 6 - 785]) / 4e3;
		main2_ .aek[j - 1] = (d__1 = main1_ .ekv[j + (l << 6) - 65] / 
			main2_ .dpd[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) );
		main2_ .hi[j - 1] = sqrt(main2_ .aek[j - 1]);
		main2_ .fi[j - 1] = main2_ .hi[j - 1] * ell_ .el[l - 1];
		main2_ .si[j - 1] = sin(main2_ .fi[j - 1]);
		main2_ .co[j - 1] = cos(main2_ .fi[j - 1]);
		syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 786] = main2_ .co[
			j - 1];
		syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 785] = main2_ .si[
			j - 1] / main2_ .hi[j - 1];
		syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 784] = 
			- main2_ .si[j - 1] * main2_ .hi[j - 1];
		syos_ .al[(ih2 + (j + (l << 6) << 1)) * 6 - 783] = main2_ .co[
			j - 1];
		syos_ .as[(ih2 + (j + (l << 6) << 1)) * 6 - 783] = 
			- main1_ .rvv[j - 1] * syos_ .al[(ih2 + (j + (l << 6) 
			<< 1)) * 6 - 785] * syos_ .al[(ih2 + (j + (l << 6) << 
			1)) * 6 - 784] / 2e3;
		syos_ .as[(ih2 + (j + (l << 6) << 1)) * 6 - 782] = 
			- main1_ .rvv[j - 1] * (ell_ .el[l - 1] - syos_ .al[(
			ih2 + (j + (l << 6) << 1)) * 6 - 786] * syos_ .al[(
			ih2 + (j + (l << 6) << 1)) * 6 - 785]) * main2_ .aek[
			j - 1] / 4e3;
		syos_ .as[(ih2 + (j + (l << 6) << 1)) * 6 - 781] = 
			- main1_ .rvv[j - 1] * (ell_ .el[l - 1] + syos_ .al[(
			ih2 + (j + (l << 6) << 1)) * 6 - 786] * syos_ .al[(
			ih2 + (j + (l << 6) << 1)) * 6 - 785]) / 4e3;
	    }
 
	}
	goto L160;
 

 
 

L140:
	i__2 = tra1_ .napx;
	for (j = 1; j <= i__2; ++j) {
	    main2_ .rhoi[j - 1] = ell_ .ed[l - 1] / main2_ .dpsq[j - 1];
	    main2_ .fok[j - 1] = main2_ .rhoi[j - 1] * tan(ell_ .el[l - 1] * 
		    main2_ .rhoi[j - 1] * .5);
	    syos_ .al[((j + (l << 6) << 1) + 1) * 6 - 784] = main2_ .fok[j - 
		    1];
	    syos_ .al[((j + (l << 6) << 1) + 2) * 6 - 784] = - main2_ .fok[j - 
		    1];
 
	}
L160:
	;
    }
 
    return 0;
}  

 
  int take6_(h__, m, ht)
integer *h__, *m, *ht;
{
     

    static integer b1 = 0;
    static integer b2 = 0;

     
    integer i__1;

     
    extern   int dadal_(), daall_(), dacop_(), dasub_(), 
	    danot_();

 
 



    daall_(h__, &c__1, "H         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(ht, &c__1, "HT        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&b1, &c__1, "B1        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&b2, &c__1, "B2        ", & ii_ .no, & ii_ .nv, 10L);
 
    danot_(m);
    dacop_(h__, &b1);
    i__1 = *m - 1;
    danot_(&i__1);
    dacop_(&b1, &b2);
    danot_(& ii_ .no);
    dasub_(&b1, &b2, ht);
    dadal_(&b2, &c__1);
    dadal_(&b1, &c__1);
    return 0;
}  

 
  int taked6_(h__, m, ht)
integer *h__, *m, *ht;
{
     

    static integer b1 = 0;
    static integer b2 = 0;

     
    integer i__1;

     
    static integer i__;
    extern   int dadal_(), daall_(), dacop_(), dasub_(), 
	    danot_();

 
 


     
    --ht;
    --h__;

     

    daall_(&h__[1], &c__12, "H         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&ht[1], &c__12, "HT        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&b1, &c__1, "B1        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&b2, &c__1, "B2        ", & ii_ .no, & ii_ .nv, 10L);
 
    for (i__ = 1; i__ <= 6; ++i__) {
	danot_(m);
	dacop_(&h__[i__], &b1);
	i__1 = *m - 1;
	danot_(&i__1);
	dacop_(&b1, &b2);
	danot_(& ii_ .no);
 
	dasub_(&b1, &b2, &ht[i__]);
    }
    dadal_(&b2, &c__1);
    dadal_(&b1, &c__1);
    return 0;
}  

 
 
  int thck4d_(nthinerr)
integer *nthinerr;
{
     
    integer i__1, i__2, i__3, i__4;
    doublereal d__1;

     
    double exp(), sqrt(), d_sign();

     
    extern   int lostpar2_(), lostpar3_(), writebin_(), 
	    lostpart_();
    static integer i__, j, k, n;
    static doublereal r0, rb[64];
    static integer ix;
    static doublereal r2b[64], crkveb[64], cikveb[64], rho2b[64], tkb[64], 
	    rkb[64], xrb[64], zrb[64], xbb[64], zbb[64], crxb[64], crzb[64], 
	    cbxb[64], cbzb[64];
    static integer idz1, idz2;
    extern   int ripple_();
    static doublereal puxve, puzve, crkve, cikve, xlvj, zlvj;
    static integer nmz;
    static doublereal yv1j, yv2j;
    extern   int errf_(), wzsubv_();
    static integer kpz;
    extern   int dist1_(), write6_();
    static doublereal crkveuk;

 


 


 
 

 
 

    *nthinerr = 0;
    idz1 = syos_ .idz[0];
    idz2 = syos_ .idz[1];
    i__1 = tra1_ .numl;
    for (n = 1; n <= i__1; ++n) {
	main4_ .numx = n - 1;
	if (ripp_ .irip == 1) {
	    ripple_(&n);
	}
	if (main4_ .numx % track_ .nwri == 0) {
	    writebin_(nthinerr);
	}
	if (*nthinerr != 0) {
	    return 0;
	}
	i__2 = str_ .iu;
	for (i__ = 1; i__ <= i__2; ++i__) {
	    if (track_ .ktrack[i__ - 1] == 1) {
		ix = str_ .ic[i__ - 1];
	    } else {
		ix = str_ .ic[i__ - 1] - 300;
	    }
	    switch ((int)(track_ .ktrack[i__ - 1])) {
		case 1:  goto L20;
		case 2:  goto L480;
		case 3:  goto L480;
		case 4:  goto L480;
		case 5:  goto L480;
		case 6:  goto L480;
		case 7:  goto L480;
		case 8:  goto L480;
		case 9:  goto L480;
		case 10:  goto L480;
		case 11:  goto L40;
		case 12:  goto L60;
		case 13:  goto L80;
		case 14:  goto L100;
		case 15:  goto L120;
		case 16:  goto L140;
		case 17:  goto L160;
		case 18:  goto L180;
		case 19:  goto L200;
		case 20:  goto L220;
		case 21:  goto L270;
		case 22:  goto L290;
		case 23:  goto L310;
		case 24:  goto L330;
		case 25:  goto L350;
		case 26:  goto L370;
		case 27:  goto L390;
		case 28:  goto L410;
		case 29:  goto L430;
		case 30:  goto L450;
		case 31:  goto L470;
		case 32:  goto L240;
		case 33:  goto L500;
		case 34:  goto L520;
		case 35:  goto L540;
		case 36:  goto L560;
		case 37:  goto L580;
		case 38:  goto L600;
		case 39:  goto L620;
		case 40:  goto L640;
		case 41:  goto L680;
		case 42:  goto L700;
		case 43:  goto L720;
	    }
	    goto L480;
L20:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		puxve = main1_ .xv[(j << 1) - 2];
		puzve = main1_ .yv[(j << 1) - 2];
		main1_ .xv[(j << 1) - 2] = main3_ .bl1v[((j + (ix << 6) << 1) 
			+ 1) * 6 - 786] * puxve + main3_ .bl1v[((j + (ix << 6)
			 << 1) + 1) * 6 - 785] * puzve + idz1 * main3_ .bl1v[(
			(j + (ix << 6) << 1) + 1) * 6 - 782] * main1_ .dpsv[j 
			- 1] * 1e3;
		main1_ .yv[(j << 1) - 2] = main3_ .bl1v[((j + (ix << 6) << 1) 
			+ 1) * 6 - 784] * puxve + main3_ .bl1v[((j + (ix << 6)
			 << 1) + 1) * 6 - 783] * puzve + idz1 * main3_ .bl1v[(
			(j + (ix << 6) << 1) + 1) * 6 - 781] * main1_ .dpsv[j 
			- 1] * 1e3;
		puxve = main1_ .xv[(j << 1) - 1];
		puzve = main1_ .yv[(j << 1) - 1];
		main1_ .xv[(j << 1) - 1] = main3_ .bl1v[((j + (ix << 6) << 1) 
			+ 2) * 6 - 786] * puxve + main3_ .bl1v[((j + (ix << 6)
			 << 1) + 2) * 6 - 785] * puzve + idz2 * main3_ .bl1v[(
			(j + (ix << 6) << 1) + 2) * 6 - 782] * main1_ .dpsv[j 
			- 1] * 1e3;
		main1_ .yv[(j << 1) - 1] = main3_ .bl1v[((j + (ix << 6) << 1) 
			+ 2) * 6 - 784] * puxve + main3_ .bl1v[((j + (ix << 6)
			 << 1) + 2) * 6 - 783] * puzve + idz2 * main3_ .bl1v[(
			(j + (ix << 6) << 1) + 2) * 6 - 781] * main1_ .dpsv[j 
			- 1] * 1e3;
 
	    }
	    goto L480;
 
L40:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .yv[(j << 1) - 2] += track_ .strackc[i__ - 1] * 
			main2_ .oidpsv[j - 1];
		main1_ .yv[(j << 1) - 1] += track_ .stracks[i__ - 1] * 
			main2_ .oidpsv[j - 1];
 
	    }
	    goto L470;
 
L60:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L470;
 
L80:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L470;
 
L100:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L470;
 
L120:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L470;
 
L140:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L470;
 
L160:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L470;
 
L180:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L470;
 
L200:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L470;
 
L220:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L470;
L500:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - (
			track_ .strack[i__ - 1] * xlvj * main2_ .oidpsv[j - 1]
			 + track_ .dpsv1[j - 1]) * dkic_ .dki[ix - 1] * 
			rand1_ .tiltc[i__ - 1] + dkic_ .dki[ix - 1] * 1e3 * 
			main2_ .oidpsv[j - 1] * (1. - rand1_ .tiltc[i__ - 1]);
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - (
			track_ .strack[i__ - 1] * xlvj * main2_ .oidpsv[j - 1]
			 + track_ .dpsv1[j - 1]) * dkic_ .dki[ix - 1] * 
			rand1_ .tilts[i__ - 1] + dkic_ .dki[ix - 1] * 1e3 * 
			main2_ .oidpsv[j - 1] * rand1_ .tilts[i__ - 1];
 
	    }
	    goto L470;
L520:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - (
			track_ .strack[i__ - 1] * xlvj * main2_ .oidpsv[j - 1]
			 + track_ .dpsv1[j - 1]) * dkic_ .dki[ix - 1] * 
			rand1_ .tiltc[i__ - 1] + dkic_ .dki[ix - 1] * 1e3 * 
			main2_ .oidpsv[j - 1] * (1. - rand1_ .tiltc[i__ - 1]);
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - (
			track_ .strack[i__ - 1] * xlvj * main2_ .oidpsv[j - 1]
			 + track_ .dpsv1[j - 1]) * dkic_ .dki[ix - 1] * 
			rand1_ .tilts[i__ - 1] + dkic_ .dki[ix - 1] * 1e3 * 
			main2_ .oidpsv[j - 1] * rand1_ .tilts[i__ - 1];
 
	    }
	    goto L240;
L540:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - 
			track_ .strackc[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix - 1] * 1e3 * main2_ .oidpsv[j - 1] * (
			1. - rand1_ .tiltc[i__ - 1]);
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - 
			track_ .stracks[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix - 1] * 1e3 * main2_ .oidpsv[j - 1] * 
			rand1_ .tilts[i__ - 1];
 
	    }
	    goto L470;
L560:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - 
			track_ .strackc[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix - 1] * 1e3 * main2_ .oidpsv[j - 1] * (
			1. - rand1_ .tiltc[i__ - 1]);
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - 
			track_ .stracks[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix - 1] * 1e3 * main2_ .oidpsv[j - 1] * 
			rand1_ .tilts[i__ - 1];
 
	    }
	    goto L240;
L580:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] + (
			track_ .strack[i__ - 1] * zlvj * main2_ .oidpsv[j - 1]
			 - track_ .dpsv1[j - 1]) * dkic_ .dki[ix + 699] * 
			rand1_ .tilts[i__ - 1] + dkic_ .dki[ix + 699] * 1e3 * 
			main2_ .oidpsv[j - 1] * rand1_ .tilts[i__ - 1];
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - (
			track_ .strack[i__ - 1] * zlvj * main2_ .oidpsv[j - 1]
			 - track_ .dpsv1[j - 1]) * dkic_ .dki[ix + 699] * 
			rand1_ .tiltc[i__ - 1] - dkic_ .dki[ix + 699] * 1e3 * 
			main2_ .oidpsv[j - 1] * (1. - rand1_ .tiltc[i__ - 1]);
 
	    }
	    goto L470;
L600:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] + (
			track_ .strack[i__ - 1] * zlvj * main2_ .oidpsv[j - 1]
			 - track_ .dpsv1[j - 1]) * dkic_ .dki[ix + 699] * 
			rand1_ .tilts[i__ - 1] + dkic_ .dki[ix + 699] * 1e3 * 
			main2_ .oidpsv[j - 1] * rand1_ .tilts[i__ - 1];
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - (
			track_ .strack[i__ - 1] * zlvj * main2_ .oidpsv[j - 1]
			 - track_ .dpsv1[j - 1]) * dkic_ .dki[ix + 699] * 
			rand1_ .tiltc[i__ - 1] - dkic_ .dki[ix + 699] * 1e3 * 
			main2_ .oidpsv[j - 1] * (1. - rand1_ .tiltc[i__ - 1]);
 
	    }
	    goto L240;
L620:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - 
			track_ .stracks[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix + 699] * 1e3 * main2_ .oidpsv[j - 1] * 
			rand1_ .tilts[i__ - 1];
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] + 
			track_ .strackc[i__ - 1] * track_ .dpsv1[j - 1] - 
			dkic_ .dki[ix + 699] * 1e3 * main2_ .oidpsv[j - 1] * (
			1. - rand1_ .tiltc[i__ - 1]);
 
	    }
	    goto L470;
L640:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - 
			track_ .stracks[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix + 699] * 1e3 * main2_ .oidpsv[j - 1] * 
			rand1_ .tilts[i__ - 1];
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] + 
			track_ .strackc[i__ - 1] * track_ .dpsv1[j - 1] - 
			dkic_ .dki[ix + 699] * 1e3 * main2_ .oidpsv[j - 1] * (
			1. - rand1_ .tiltc[i__ - 1]);
 
	    }
L240:
	    r0 = ell_ .ek[ix - 1];
	    nmz = mult1_ .nmu[ix - 1];
	    if (nmz >= 2) {
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) 
			    * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 
			    1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 
			    1];
		    zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1])
			     * rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) 
			    - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ 
			    - 1];
		    yv1j = main1_ .bbiv[(i__ + 1) * 11 - 22] + main1_ .bbiv[(
			    i__ + 1) * 11 - 21] * xlvj + main1_ .aaiv[(i__ + 
			    1) * 11 - 21] * zlvj;
		    yv2j = main1_ .aaiv[(i__ + 1) * 11 - 22] - main1_ .bbiv[(
			    i__ + 1) * 11 - 21] * zlvj + main1_ .aaiv[(i__ + 
			    1) * 11 - 21] * xlvj;
		    crkve = xlvj;
		    cikve = zlvj;
		    i__4 = nmz;
		    for (k = 3; k <= i__4; ++k) {
			crkveuk = crkve * xlvj - cikve * zlvj;
			cikve = crkve * zlvj + cikve * xlvj;
			crkve = crkveuk;
			yv1j = yv1j + main1_ .bbiv[k + (i__ + 1) * 11 - 23] * 
				crkve + main1_ .aaiv[k + (i__ + 1) * 11 - 23] 
				* cikve;
			yv2j = yv2j - main1_ .bbiv[k + (i__ + 1) * 11 - 23] * 
				cikve + main1_ .aaiv[k + (i__ + 1) * 11 - 23] 
				* crkve;
 
		    }
		    main1_ .yv[(j << 1) - 2] += (rand1_ .tiltc[i__ - 1] * 
			    yv1j - rand1_ .tilts[i__ - 1] * yv2j) * 
			    main2_ .oidpsv[j - 1];
		    main1_ .yv[(j << 1) - 1] += (rand1_ .tiltc[i__ - 1] * 
			    yv2j + rand1_ .tilts[i__ - 1] * yv1j) * 
			    main2_ .oidpsv[j - 1];
 
		}
	    } else {
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    main1_ .yv[(j << 1) - 2] += (rand1_ .tiltc[i__ - 1] * 
			    main1_ .bbiv[(i__ + 1) * 11 - 22] - rand1_ .tilts[
			    i__ - 1] * main1_ .aaiv[(i__ + 1) * 11 - 22]) * 
			    main2_ .oidpsv[j - 1];
		    main1_ .yv[(j << 1) - 1] += (rand1_ .tiltc[i__ - 1] * 
			    main1_ .aaiv[(i__ + 1) * 11 - 22] + rand1_ .tilts[
			    i__ - 1] * main1_ .bbiv[(i__ + 1) * 11 - 22]) * 
			    main2_ .oidpsv[j - 1];
 
		}
	    }
	    goto L470;
 
 
L270:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .yv[(j << 1) - 2] -= track_ .stracks[i__ - 1] * 
			main2_ .oidpsv[j - 1];
		main1_ .yv[(j << 1) - 1] += track_ .strackc[i__ - 1] * 
			main2_ .oidpsv[j - 1];
 
	    }
	    goto L470;
 
L290:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L470;
 
L310:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L470;
 
L330:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L470;
 
L350:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L470;
 
L370:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L470;
 
L390:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L470;
 
L410:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L470;
 
L430:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L470;
 
L450:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L470;
L680:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		crkveb[j - 1] = main1_ .xv[(j << 1) - 2] - beam_ .clobeam[(j 
			+ (ix << 6) << 1) - 130] + ell_ .ed[ix - 1];
		cikveb[j - 1] = main1_ .xv[(j << 1) - 1] - beam_ .clobeam[(j 
			+ (ix << 6) << 1) - 129] + ell_ .ek[ix - 1];
		rho2b[j - 1] = crkveb[j - 1] * crkveb[j - 1] + cikveb[j - 1] *
			 cikveb[j - 1];
		if (rho2b[j - 1] <= 1e-17) {
		    goto L690;
		}
		tkb[j - 1] = rho2b[j - 1] / (beam_ .sigman2[(j + (ix << 6) << 
			1) - 130] * 2.);
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strack[i__ - 1] * crkveb[j - 1] / rho2b[j - 1]
			 * (1. - exp(-tkb[j - 1])) - beam_ .beamoff[(j + (ix 
			<< 6) << 1) - 130]);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strack[i__ - 1] * cikveb[j - 1] / rho2b[j - 1]
			 * (1. - exp(-tkb[j - 1])) - beam_ .beamoff[(j + (ix 
			<< 6) << 1) - 129]);
L690:
		;
	    }
	    goto L470;
L700:
	    if (beam_ .ibtyp == 0) {
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) - 130] 
			    - beam_ .sigman2[(j + (ix << 6) << 1) - 129]) * 
			    2.;
		    rb[j - 1] = sqrt(r2b[j - 1]);
		    rkb[j - 1] = track_ .strack[i__ - 1] * kons_ .pisqrt / rb[
			    j - 1];
		    crkveb[j - 1] = main1_ .xv[(j << 1) - 2] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 130] + ell_ .ed[ix - 1];
		    cikveb[j - 1] = main1_ .xv[(j << 1) - 1] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 129] + ell_ .ek[ix - 1];
		    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    errf_(&xrb[j - 1], &zrb[j - 1], &crxb[j - 1], &crzb[j - 1]
			    );
		    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
			    beam_ .sigman2[(j + (ix << 6) << 1) - 130] + 
			    cikveb[j - 1] * cikveb[j - 1] / beam_ .sigman2[(j 
			    + (ix << 6) << 1) - 129]) / 2.;
		    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 129] * 
			    xrb[j - 1];
		    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 130] * 
			    zrb[j - 1];
		    errf_(&xbb[j - 1], &zbb[j - 1], &cbxb[j - 1], &cbzb[j - 1]
			    );
		    main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) * cbzb[j 
			    - 1]) * d_sign(&c_b2366, &crkveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130]);
		    main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) * cbxb[j 
			    - 1]) * d_sign(&c_b2366, &cikveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129]);
 
		}
	    } else if (beam_ .ibtyp == 1) {
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) - 130] 
			    - beam_ .sigman2[(j + (ix << 6) << 1) - 129]) * 
			    2.;
		    rb[j - 1] = sqrt(r2b[j - 1]);
		    rkb[j - 1] = track_ .strack[i__ - 1] * kons_ .pisqrt / rb[
			    j - 1];
		    crkveb[j - 1] = main1_ .xv[(j << 1) - 2] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 130] + ell_ .ed[ix - 1];
		    cikveb[j - 1] = main1_ .xv[(j << 1) - 1] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 129] + ell_ .ek[ix - 1];
		    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
			    beam_ .sigman2[(j + (ix << 6) << 1) - 130] + 
			    cikveb[j - 1] * cikveb[j - 1] / beam_ .sigman2[(j 
			    + (ix << 6) << 1) - 129]) / 2.;
		    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 129] * 
			    xrb[j - 1];
		    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 130] * 
			    zrb[j - 1];
 
		}
		wzsubv_(& tra1_ .napx, xrb, zrb, crxb, crzb);
		wzsubv_(& tra1_ .napx, xbb, zbb, cbxb, cbzb);
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) * cbzb[j 
			    - 1]) * d_sign(&c_b2366, &crkveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130]);
		    main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) * cbxb[j 
			    - 1]) * d_sign(&c_b2366, &cikveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129]);
 
		}
	    }
	    goto L470;
L720:
	    if (beam_ .ibtyp == 0) {
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) - 129] 
			    - beam_ .sigman2[(j + (ix << 6) << 1) - 130]) * 
			    2.;
		    rb[j - 1] = sqrt(r2b[j - 1]);
		    rkb[j - 1] = track_ .strack[i__ - 1] * kons_ .pisqrt / rb[
			    j - 1];
		    crkveb[j - 1] = main1_ .xv[(j << 1) - 2] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 130] + ell_ .ed[ix - 1];
		    cikveb[j - 1] = main1_ .xv[(j << 1) - 1] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 129] + ell_ .ek[ix - 1];
		    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    errf_(&zrb[j - 1], &xrb[j - 1], &crzb[j - 1], &crxb[j - 1]
			    );
		    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
			    beam_ .sigman2[(j + (ix << 6) << 1) - 130] + 
			    cikveb[j - 1] * cikveb[j - 1] / beam_ .sigman2[(j 
			    + (ix << 6) << 1) - 129]) / 2.;
		    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 129] * 
			    xrb[j - 1];
		    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 130] * 
			    zrb[j - 1];
		    errf_(&zbb[j - 1], &xbb[j - 1], &cbzb[j - 1], &cbxb[j - 1]
			    );
		    main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) * cbzb[j 
			    - 1]) * d_sign(&c_b2366, &crkveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130]);
		    main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) * cbxb[j 
			    - 1]) * d_sign(&c_b2366, &cikveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129]);
 
		}
	    } else if (beam_ .ibtyp == 1) {
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) - 129] 
			    - beam_ .sigman2[(j + (ix << 6) << 1) - 130]) * 
			    2.;
		    rb[j - 1] = sqrt(r2b[j - 1]);
		    rkb[j - 1] = track_ .strack[i__ - 1] * kons_ .pisqrt / rb[
			    j - 1];
		    crkveb[j - 1] = main1_ .xv[(j << 1) - 2] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 130] + ell_ .ed[ix - 1];
		    cikveb[j - 1] = main1_ .xv[(j << 1) - 1] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 129] + ell_ .ek[ix - 1];
		    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
			    beam_ .sigman2[(j + (ix << 6) << 1) - 130] + 
			    cikveb[j - 1] * cikveb[j - 1] / beam_ .sigman2[(j 
			    + (ix << 6) << 1) - 129]) / 2.;
		    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 129] * 
			    xrb[j - 1];
		    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 130] * 
			    zrb[j - 1];
 
		}
		wzsubv_(& tra1_ .napx, zrb, xrb, crzb, crxb);
		wzsubv_(& tra1_ .napx, zbb, xbb, cbzb, cbxb);
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) * cbzb[j 
			    - 1]) * d_sign(&c_b2366, &crkveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130]);
		    main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) * cbxb[j 
			    - 1]) * d_sign(&c_b2366, &cikveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129]);
 
		}
	    }
L470:
	    kpz = (i__3 = ell_ .kp[ix - 1], (( i__3 ) >= 0 ? ( i__3 ) : -( i__3 )) );
	    if (kpz == 0) {
		goto L480;
	    }
	    if (kpz == 1) {
		lostpar2_(&i__, &ix, nthinerr);
		if (*nthinerr != 0) {
		    return 0;
		}
		goto L480;
	    }
	    if (kpz == 3) {
		lostpar3_(&i__, &ix, nthinerr);
		if (*nthinerr != 0) {
		    return 0;
		}
	    }
L480:
	    ;
	}
	lostpart_(nthinerr);
	if (*nthinerr != 0) {
	    return 0;
	}
	if (tra1_ .ntwin != 2) {
	    dist1_();
	}
	if (n % tra1_ .nwr[3] == 0) {
	    write6_(&n);
	}
 
    }
    return 0;
}  

 
 
  int thck6d_(nthinerr)
integer *nthinerr;
{
     
    integer i__1, i__2, i__3, i__4;
    doublereal d__1, d__2, d__3;

     
    double sin(), sqrt();
    integer s_wsfe(), do_fio(), e_wsfe();
    double exp(), d_sign();

     
    extern   int lostpar2_(), lostpar3_(), writebin_(), 
	    synuthck_(), lostpart_();
    static integer i__, j, k, n;
    static doublereal r0, rb[64];
    static integer ix, jb, jx;
    static doublereal r2b[64], crkveb[64], cikveb[64], rho2b[64], tkb[64], 
	    rkb[64], xrb[64], zrb[64], xbb[64], zbb[64], crxb[64], crzb[64], 
	    cbxb[64], cbzb[64];
    static integer idz1, idz2;
    extern   int ripple_();
    static integer jmel;
    static doublereal puxve1, puzve1, puxve2, puzve2, crkve, cikve, xlvj, 
	    zlvj;
    static integer nmz;
    static doublereal yv1j, yv2j;
    extern   int errf_(), wzsubv_();
    static integer kpz;
    static doublereal crkveuk;
    extern   int dist1_(), write6_();

     
    static cilist io___4229 = { 0, 98, 0, "(1p,6(2x,e25.18))", 0 };


 


 


 
 

 
 

    *nthinerr = 0;
    idz1 = syos_ .idz[0];
    idz2 = syos_ .idz[1];
    i__1 = tra1_ .numl;
    for (n = 1; n <= i__1; ++n) {
	main4_ .numx = n - 1;
	if (ripp_ .irip == 1) {
	    ripple_(&n);
	}
	if (main4_ .numx % track_ .nwri == 0) {
	    writebin_(nthinerr);
	}
	if (*nthinerr != 0) {
	    return 0;
	}
	i__2 = str_ .iu;
	for (i__ = 1; i__ <= i__2; ++i__) {
	    if (track_ .ktrack[i__ - 1] == 1) {
		ix = str_ .ic[i__ - 1];
	    } else {
		ix = str_ .ic[i__ - 1] - 300;
	    }
	    switch ((int)(track_ .ktrack[i__ - 1])) {
		case 1:  goto L20;
		case 2:  goto L40;
		case 3:  goto L500;
		case 4:  goto L500;
		case 5:  goto L500;
		case 6:  goto L500;
		case 7:  goto L500;
		case 8:  goto L500;
		case 9:  goto L500;
		case 10:  goto L500;
		case 11:  goto L60;
		case 12:  goto L80;
		case 13:  goto L100;
		case 14:  goto L120;
		case 15:  goto L140;
		case 16:  goto L160;
		case 17:  goto L180;
		case 18:  goto L200;
		case 19:  goto L220;
		case 20:  goto L240;
		case 21:  goto L290;
		case 22:  goto L310;
		case 23:  goto L330;
		case 24:  goto L350;
		case 25:  goto L370;
		case 26:  goto L390;
		case 27:  goto L410;
		case 28:  goto L430;
		case 29:  goto L450;
		case 30:  goto L470;
		case 31:  goto L490;
		case 32:  goto L260;
		case 33:  goto L520;
		case 34:  goto L540;
		case 35:  goto L560;
		case 36:  goto L580;
		case 37:  goto L600;
		case 38:  goto L620;
		case 39:  goto L640;
		case 40:  goto L660;
		case 41:  goto L680;
		case 42:  goto L700;
		case 43:  goto L720;
	    }
	    goto L500;
L20:
	    jmel = str2_ .mel[ix - 1];
	    i__3 = jmel;
	    for (jb = 1; jb <= i__3; ++jb) {
		jx = str2_ .mtyp[ix + jb * 300 - 301];
		i__4 = tra1_ .napx;
		for (j = 1; j <= i__4; ++j) {
		    puxve1 = main1_ .xv[(j << 1) - 2];
		    puzve1 = main1_ .yv[(j << 1) - 2];
		    puxve2 = main1_ .xv[(j << 1) - 1];
		    puzve2 = main1_ .yv[(j << 1) - 1];
		    main1_ .sigmv[j - 1] = main1_ .sigmv[j - 1] + syos_ .as[((
			    j + (jx << 6) << 1) + 1) * 6 - 786] + puxve1 * (
			    syos_ .as[((j + (jx << 6) << 1) + 1) * 6 - 785] + 
			    syos_ .as[((j + (jx << 6) << 1) + 1) * 6 - 783] * 
			    puzve1 + syos_ .as[((j + (jx << 6) << 1) + 1) * 6 
			    - 782] * puxve1) + puzve1 * (syos_ .as[((j + (jx 
			    << 6) << 1) + 1) * 6 - 784] + syos_ .as[((j + (jx 
			    << 6) << 1) + 1) * 6 - 781] * puzve1) + syos_ .as[
			    ((j + (jx << 6) << 1) + 2) * 6 - 786] + puxve2 * (
			    syos_ .as[((j + (jx << 6) << 1) + 2) * 6 - 785] + 
			    syos_ .as[((j + (jx << 6) << 1) + 2) * 6 - 783] * 
			    puzve2 + syos_ .as[((j + (jx << 6) << 1) + 2) * 6 
			    - 782] * puxve2) + puzve2 * (syos_ .as[((j + (jx 
			    << 6) << 1) + 2) * 6 - 784] + syos_ .as[((j + (jx 
			    << 6) << 1) + 2) * 6 - 781] * puzve2);
		    main1_ .xv[(j << 1) - 2] = syos_ .al[((j + (jx << 6) << 1)
			     + 1) * 6 - 786] * puxve1 + syos_ .al[((j + (jx <<
			     6) << 1) + 1) * 6 - 785] * puzve1 + idz1 * 
			    syos_ .al[((j + (jx << 6) << 1) + 1) * 6 - 782];
		    main1_ .xv[(j << 1) - 1] = syos_ .al[((j + (jx << 6) << 1)
			     + 2) * 6 - 786] * puxve2 + syos_ .al[((j + (jx <<
			     6) << 1) + 2) * 6 - 785] * puzve2 + idz2 * 
			    syos_ .al[((j + (jx << 6) << 1) + 2) * 6 - 782];
		    main1_ .yv[(j << 1) - 2] = syos_ .al[((j + (jx << 6) << 1)
			     + 1) * 6 - 784] * puxve1 + syos_ .al[((j + (jx <<
			     6) << 1) + 1) * 6 - 783] * puzve1 + idz1 * 
			    syos_ .al[((j + (jx << 6) << 1) + 1) * 6 - 781];
		    main1_ .yv[(j << 1) - 1] = syos_ .al[((j + (jx << 6) << 1)
			     + 2) * 6 - 784] * puxve2 + syos_ .al[((j + (jx <<
			     6) << 1) + 2) * 6 - 783] * puzve2 + idz2 * 
			    syos_ .al[((j + (jx << 6) << 1) + 2) * 6 - 781];
 
		}
	    }
	    goto L500;
L40:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .ejf0v[j - 1] = main1_ .ejfv[j - 1];
		if ((( syn_ .dppoff ) >= 0 ? ( syn_ .dppoff ) : -( syn_ .dppoff ))  > 1e-17) {
		    main1_ .sigmv[j - 1] -= syn_ .sigmoff[i__ - 1];
		}
		if (ell_ .kz[ix - 1] == 12) {
		    main1_ .ejv[j - 1] += ell_ .ed[ix - 1] * sin(syn_ .hsyc[
			    ix - 1] * main1_ .sigmv[j - 1] + syn_ .phasc[ix - 
			    1]);
		} else {
		    main1_ .ejv[j - 1] += syn_ .hsy[0] * sin(syn_ .hsy[2] * 
			    main1_ .sigmv[j - 1]);
		}
		main1_ .ejfv[j - 1] = sqrt(main1_ .ejv[j - 1] * main1_ .ejv[j 
			- 1] - syn_ .pma * syn_ .pma);
		main1_ .rvv[j - 1] = main1_ .ejv[j - 1] / syn_ .e0 * 
			main4_ .e0f / main1_ .ejfv[j - 1];
		main1_ .dpsv[j - 1] = (main1_ .ejfv[j - 1] - main4_ .e0f) / 
			main4_ .e0f;
		main2_ .oidpsv[j - 1] = 1. / (main1_ .dpsv[j - 1] + 1.);
		track_ .dpsv1[j - 1] = main1_ .dpsv[j - 1] * 1e3 * 
			main2_ .oidpsv[j - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .ejf0v[j - 1] / 
			main1_ .ejfv[j - 1] * main1_ .yv[(j << 1) - 2];
 
		main1_ .yv[(j << 1) - 1] = main1_ .ejf0v[j - 1] / 
			main1_ .ejfv[j - 1] * main1_ .yv[(j << 1) - 1];
	    }
	    if (n == 1) {
		s_wsfe(&io___4229);
		i__4 = tra1_ .napx;
		for (j = 1; j <= i__4; ++j) {
		    do_fio(&c__1, (char *)& main1_ .xv[(j << 1) - 2], (ftnlen)
			    sizeof(doublereal));
		    d__1 = main1_ .yv[(j << 1) - 2] * (main1_ .dpsv[j - 1] + 
			    1.);
		    do_fio(&c__1, (char *)&d__1, (ftnlen)sizeof(doublereal));
		    do_fio(&c__1, (char *)& main1_ .xv[(j << 1) - 1], (ftnlen)
			    sizeof(doublereal));
		    d__2 = main1_ .yv[(j << 1) - 1] * (main1_ .dpsv[j - 1] + 
			    1.);
		    do_fio(&c__1, (char *)&d__2, (ftnlen)sizeof(doublereal));
		    do_fio(&c__1, (char *)& main1_ .sigmv[j - 1], (ftnlen)
			    sizeof(doublereal));
		    d__3 = main1_ .dpsv[j - 1] * 1e3;
		    do_fio(&c__1, (char *)&d__3, (ftnlen)sizeof(doublereal));
		}
		e_wsfe();
	    }
	    synuthck_();
	    goto L490;
 
L60:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .yv[(j << 1) - 2] += track_ .strackc[i__ - 1] * 
			main2_ .oidpsv[j - 1];
		main1_ .yv[(j << 1) - 1] += track_ .stracks[i__ - 1] * 
			main2_ .oidpsv[j - 1];
 
	    }
	    goto L490;
 
L80:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L490;
 
L100:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L490;
 
L120:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L490;
 
L140:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L490;
 
L160:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L490;
 
L180:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L490;
 
L200:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L490;
 
L220:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L490;
 
L240:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L490;
L520:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - (
			track_ .strack[i__ - 1] * xlvj * main2_ .oidpsv[j - 1]
			 + track_ .dpsv1[j - 1]) * dkic_ .dki[ix - 1] * 
			rand1_ .tiltc[i__ - 1] + dkic_ .dki[ix - 1] * 1e3 * 
			main2_ .oidpsv[j - 1] * (1. - rand1_ .tiltc[i__ - 1]);
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - (
			track_ .strack[i__ - 1] * xlvj * main2_ .oidpsv[j - 1]
			 + track_ .dpsv1[j - 1]) * dkic_ .dki[ix - 1] * 
			rand1_ .tilts[i__ - 1] + dkic_ .dki[ix - 1] * 1e3 * 
			main2_ .oidpsv[j - 1] * rand1_ .tilts[i__ - 1];
		main1_ .sigmv[j - 1] += main1_ .rvv[j - 1] * dkic_ .dki[ix - 
			1] * xlvj;
 
	    }
	    goto L490;
L540:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - (
			track_ .strack[i__ - 1] * xlvj * main2_ .oidpsv[j - 1]
			 + track_ .dpsv1[j - 1]) * dkic_ .dki[ix - 1] * 
			rand1_ .tiltc[i__ - 1] + dkic_ .dki[ix - 1] * 1e3 * 
			main2_ .oidpsv[j - 1] * (1. - rand1_ .tiltc[i__ - 1]);
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - (
			track_ .strack[i__ - 1] * xlvj * main2_ .oidpsv[j - 1]
			 + track_ .dpsv1[j - 1]) * dkic_ .dki[ix - 1] * 
			rand1_ .tilts[i__ - 1] + dkic_ .dki[ix - 1] * 1e3 * 
			main2_ .oidpsv[j - 1] * rand1_ .tilts[i__ - 1];
		main1_ .sigmv[j - 1] += main1_ .rvv[j - 1] * dkic_ .dki[ix - 
			1] * xlvj;
 
	    }
	    goto L260;
L560:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - 
			track_ .strackc[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix - 1] * 1e3 * main2_ .oidpsv[j - 1] * (
			1. - rand1_ .tiltc[i__ - 1]);
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - 
			track_ .stracks[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix - 1] * 1e3 * main2_ .oidpsv[j - 1] * 
			rand1_ .tilts[i__ - 1];
		main1_ .sigmv[j - 1] += main1_ .rvv[j - 1] * dkic_ .dki[ix - 
			1] * xlvj;
 
	    }
	    goto L490;
L580:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - 
			track_ .strackc[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix - 1] * 1e3 * main2_ .oidpsv[j - 1] * (
			1. - rand1_ .tiltc[i__ - 1]);
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - 
			track_ .stracks[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix - 1] * 1e3 * main2_ .oidpsv[j - 1] * 
			rand1_ .tilts[i__ - 1];
		main1_ .sigmv[j - 1] += main1_ .rvv[j - 1] * dkic_ .dki[ix - 
			1] * xlvj;
 
	    }
	    goto L260;
L600:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] + (
			track_ .strack[i__ - 1] * zlvj * main2_ .oidpsv[j - 1]
			 - track_ .dpsv1[j - 1]) * dkic_ .dki[ix + 699] * 
			rand1_ .tilts[i__ - 1] + dkic_ .dki[ix + 699] * 1e3 * 
			main2_ .oidpsv[j - 1] * rand1_ .tilts[i__ - 1];
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - (
			track_ .strack[i__ - 1] * zlvj * main2_ .oidpsv[j - 1]
			 - track_ .dpsv1[j - 1]) * dkic_ .dki[ix + 699] * 
			rand1_ .tiltc[i__ - 1] - dkic_ .dki[ix + 699] * 1e3 * 
			main2_ .oidpsv[j - 1] * (1. - rand1_ .tiltc[i__ - 1]);
		main1_ .sigmv[j - 1] -= main1_ .rvv[j - 1] * dkic_ .dki[ix + 
			699] * zlvj;
 
	    }
	    goto L490;
L620:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] + (
			track_ .strack[i__ - 1] * zlvj * main2_ .oidpsv[j - 1]
			 - track_ .dpsv1[j - 1]) * dkic_ .dki[ix + 699] * 
			rand1_ .tilts[i__ - 1] + dkic_ .dki[ix + 699] * 1e3 * 
			main2_ .oidpsv[j - 1] * rand1_ .tilts[i__ - 1];
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - (
			track_ .strack[i__ - 1] * zlvj * main2_ .oidpsv[j - 1]
			 - track_ .dpsv1[j - 1]) * dkic_ .dki[ix + 699] * 
			rand1_ .tiltc[i__ - 1] - dkic_ .dki[ix + 699] * 1e3 * 
			main2_ .oidpsv[j - 1] * (1. - rand1_ .tiltc[i__ - 1]);
		main1_ .sigmv[j - 1] -= main1_ .rvv[j - 1] * dkic_ .dki[ix + 
			699] * zlvj;
 
	    }
	    goto L260;
L640:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - 
			track_ .stracks[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix + 699] * 1e3 * main2_ .oidpsv[j - 1] * 
			rand1_ .tilts[i__ - 1];
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] + 
			track_ .strackc[i__ - 1] * track_ .dpsv1[j - 1] - 
			dkic_ .dki[ix + 699] * 1e3 * main2_ .oidpsv[j - 1] * (
			1. - rand1_ .tiltc[i__ - 1]);
		main1_ .sigmv[j - 1] -= main1_ .rvv[j - 1] * dkic_ .dki[ix + 
			699] * zlvj;
 
	    }
	    goto L490;
L660:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - 
			track_ .stracks[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix + 699] * 1e3 * main2_ .oidpsv[j - 1] * 
			rand1_ .tilts[i__ - 1];
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] + 
			track_ .strackc[i__ - 1] * track_ .dpsv1[j - 1] - 
			dkic_ .dki[ix + 699] * 1e3 * main2_ .oidpsv[j - 1] * (
			1. - rand1_ .tiltc[i__ - 1]);
		main1_ .sigmv[j - 1] -= main1_ .rvv[j - 1] * dkic_ .dki[ix + 
			699] * zlvj;
 
	    }
L260:
	    r0 = ell_ .ek[ix - 1];
	    nmz = mult1_ .nmu[ix - 1];
	    if (nmz >= 2) {
		i__4 = tra1_ .napx;
		for (j = 1; j <= i__4; ++j) {
		    xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) 
			    * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 
			    1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 
			    1];
		    zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1])
			     * rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) 
			    - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ 
			    - 1];
		    yv1j = main1_ .bbiv[(i__ + 1) * 11 - 22] + main1_ .bbiv[(
			    i__ + 1) * 11 - 21] * xlvj + main1_ .aaiv[(i__ + 
			    1) * 11 - 21] * zlvj;
		    yv2j = main1_ .aaiv[(i__ + 1) * 11 - 22] - main1_ .bbiv[(
			    i__ + 1) * 11 - 21] * zlvj + main1_ .aaiv[(i__ + 
			    1) * 11 - 21] * xlvj;
		    crkve = xlvj;
		    cikve = zlvj;
		    i__3 = nmz;
		    for (k = 3; k <= i__3; ++k) {
			crkveuk = crkve * xlvj - cikve * zlvj;
			cikve = crkve * zlvj + cikve * xlvj;
			crkve = crkveuk;
			yv1j = yv1j + main1_ .bbiv[k + (i__ + 1) * 11 - 23] * 
				crkve + main1_ .aaiv[k + (i__ + 1) * 11 - 23] 
				* cikve;
			yv2j = yv2j - main1_ .bbiv[k + (i__ + 1) * 11 - 23] * 
				cikve + main1_ .aaiv[k + (i__ + 1) * 11 - 23] 
				* crkve;
 
		    }
		    main1_ .yv[(j << 1) - 2] += (rand1_ .tiltc[i__ - 1] * 
			    yv1j - rand1_ .tilts[i__ - 1] * yv2j) * 
			    main2_ .oidpsv[j - 1];
		    main1_ .yv[(j << 1) - 1] += (rand1_ .tiltc[i__ - 1] * 
			    yv2j + rand1_ .tilts[i__ - 1] * yv1j) * 
			    main2_ .oidpsv[j - 1];
 
		}
	    } else {
		i__4 = tra1_ .napx;
		for (j = 1; j <= i__4; ++j) {
		    main1_ .yv[(j << 1) - 2] += (rand1_ .tiltc[i__ - 1] * 
			    main1_ .bbiv[(i__ + 1) * 11 - 22] - rand1_ .tilts[
			    i__ - 1] * main1_ .aaiv[(i__ + 1) * 11 - 22]) * 
			    main2_ .oidpsv[j - 1];
		    main1_ .yv[(j << 1) - 1] += (rand1_ .tiltc[i__ - 1] * 
			    main1_ .aaiv[(i__ + 1) * 11 - 22] + rand1_ .tilts[
			    i__ - 1] * main1_ .bbiv[(i__ + 1) * 11 - 22]) * 
			    main2_ .oidpsv[j - 1];
 
		}
	    }
	    goto L490;
 
 
L290:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .yv[(j << 1) - 2] -= track_ .stracks[i__ - 1] * 
			main2_ .oidpsv[j - 1];
		main1_ .yv[(j << 1) - 1] += track_ .strackc[i__ - 1] * 
			main2_ .oidpsv[j - 1];
 
	    }
	    goto L490;
 
L310:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L490;
 
L330:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L490;
 
L350:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L490;
 
L370:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L490;
 
L390:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L490;
 
L410:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L490;
 
L430:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L490;
 
L450:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L490;
 
L470:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L490;
L680:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		crkveb[j - 1] = main1_ .xv[(j << 1) - 2] - beam_ .clobeam[(j 
			+ (ix << 6) << 1) - 130] + ell_ .ed[ix - 1];
		cikveb[j - 1] = main1_ .xv[(j << 1) - 1] - beam_ .clobeam[(j 
			+ (ix << 6) << 1) - 129] + ell_ .ek[ix - 1];
		rho2b[j - 1] = crkveb[j - 1] * crkveb[j - 1] + cikveb[j - 1] *
			 cikveb[j - 1];
		if (rho2b[j - 1] <= 1e-17) {
		    goto L690;
		}
		tkb[j - 1] = rho2b[j - 1] / (beam_ .sigman2[(j + (ix << 6) << 
			1) - 130] * 2.);
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strack[i__ - 1] * crkveb[j - 1] / rho2b[j - 1]
			 * (1. - exp(-tkb[j - 1])) - beam_ .beamoff[(j + (ix 
			<< 6) << 1) - 130]);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strack[i__ - 1] * cikveb[j - 1] / rho2b[j - 1]
			 * (1. - exp(-tkb[j - 1])) - beam_ .beamoff[(j + (ix 
			<< 6) << 1) - 129]);
L690:
		;
	    }
	    goto L490;
L700:
	    if (beam_ .ibtyp == 0) {
		i__4 = tra1_ .napx;
		for (j = 1; j <= i__4; ++j) {
		    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) - 130] 
			    - beam_ .sigman2[(j + (ix << 6) << 1) - 129]) * 
			    2.;
		    rb[j - 1] = sqrt(r2b[j - 1]);
		    rkb[j - 1] = track_ .strack[i__ - 1] * kons_ .pisqrt / rb[
			    j - 1];
		    crkveb[j - 1] = main1_ .xv[(j << 1) - 2] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 130] + ell_ .ed[ix - 1];
		    cikveb[j - 1] = main1_ .xv[(j << 1) - 1] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 129] + ell_ .ek[ix - 1];
		    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    errf_(&xrb[j - 1], &zrb[j - 1], &crxb[j - 1], &crzb[j - 1]
			    );
		    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
			    beam_ .sigman2[(j + (ix << 6) << 1) - 130] + 
			    cikveb[j - 1] * cikveb[j - 1] / beam_ .sigman2[(j 
			    + (ix << 6) << 1) - 129]) / 2.;
		    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 129] * 
			    xrb[j - 1];
		    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 130] * 
			    zrb[j - 1];
		    errf_(&xbb[j - 1], &zbb[j - 1], &cbxb[j - 1], &cbzb[j - 1]
			    );
		    main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) * cbzb[j 
			    - 1]) * d_sign(&c_b2366, &crkveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130]);
		    main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) * cbxb[j 
			    - 1]) * d_sign(&c_b2366, &cikveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129]);
 
		}
	    } else if (beam_ .ibtyp == 1) {
		i__4 = tra1_ .napx;
		for (j = 1; j <= i__4; ++j) {
		    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) - 130] 
			    - beam_ .sigman2[(j + (ix << 6) << 1) - 129]) * 
			    2.;
		    rb[j - 1] = sqrt(r2b[j - 1]);
		    rkb[j - 1] = track_ .strack[i__ - 1] * kons_ .pisqrt / rb[
			    j - 1];
		    crkveb[j - 1] = main1_ .xv[(j << 1) - 2] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 130] + ell_ .ed[ix - 1];
		    cikveb[j - 1] = main1_ .xv[(j << 1) - 1] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 129] + ell_ .ek[ix - 1];
		    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
			    beam_ .sigman2[(j + (ix << 6) << 1) - 130] + 
			    cikveb[j - 1] * cikveb[j - 1] / beam_ .sigman2[(j 
			    + (ix << 6) << 1) - 129]) / 2.;
		    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 129] * 
			    xrb[j - 1];
		    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 130] * 
			    zrb[j - 1];
 
		}
		wzsubv_(& tra1_ .napx, xrb, zrb, crxb, crzb);
		wzsubv_(& tra1_ .napx, xbb, zbb, cbxb, cbzb);
		i__4 = tra1_ .napx;
		for (j = 1; j <= i__4; ++j) {
		    main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) * cbzb[j 
			    - 1]) * d_sign(&c_b2366, &crkveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130]);
		    main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) * cbxb[j 
			    - 1]) * d_sign(&c_b2366, &cikveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129]);
 
		}
	    }
	    goto L490;
L720:
	    if (beam_ .ibtyp == 0) {
		i__4 = tra1_ .napx;
		for (j = 1; j <= i__4; ++j) {
		    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) - 129] 
			    - beam_ .sigman2[(j + (ix << 6) << 1) - 130]) * 
			    2.;
		    rb[j - 1] = sqrt(r2b[j - 1]);
		    rkb[j - 1] = track_ .strack[i__ - 1] * kons_ .pisqrt / rb[
			    j - 1];
		    crkveb[j - 1] = main1_ .xv[(j << 1) - 2] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 130] + ell_ .ed[ix - 1];
		    cikveb[j - 1] = main1_ .xv[(j << 1) - 1] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 129] + ell_ .ek[ix - 1];
		    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    errf_(&zrb[j - 1], &xrb[j - 1], &crzb[j - 1], &crxb[j - 1]
			    );
		    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
			    beam_ .sigman2[(j + (ix << 6) << 1) - 130] + 
			    cikveb[j - 1] * cikveb[j - 1] / beam_ .sigman2[(j 
			    + (ix << 6) << 1) - 129]) / 2.;
		    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 129] * 
			    xrb[j - 1];
		    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 130] * 
			    zrb[j - 1];
		    errf_(&zbb[j - 1], &xbb[j - 1], &cbzb[j - 1], &cbxb[j - 1]
			    );
		    main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) * cbzb[j 
			    - 1]) * d_sign(&c_b2366, &crkveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130]);
		    main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) * cbxb[j 
			    - 1]) * d_sign(&c_b2366, &cikveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129]);
 
		}
	    } else if (beam_ .ibtyp == 1) {
		i__4 = tra1_ .napx;
		for (j = 1; j <= i__4; ++j) {
		    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) - 129] 
			    - beam_ .sigman2[(j + (ix << 6) << 1) - 130]) * 
			    2.;
		    rb[j - 1] = sqrt(r2b[j - 1]);
		    rkb[j - 1] = track_ .strack[i__ - 1] * kons_ .pisqrt / rb[
			    j - 1];
		    crkveb[j - 1] = main1_ .xv[(j << 1) - 2] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 130] + ell_ .ed[ix - 1];
		    cikveb[j - 1] = main1_ .xv[(j << 1) - 1] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 129] + ell_ .ek[ix - 1];
		    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
			    beam_ .sigman2[(j + (ix << 6) << 1) - 130] + 
			    cikveb[j - 1] * cikveb[j - 1] / beam_ .sigman2[(j 
			    + (ix << 6) << 1) - 129]) / 2.;
		    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 129] * 
			    xrb[j - 1];
		    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 130] * 
			    zrb[j - 1];
 
		}
		wzsubv_(& tra1_ .napx, zrb, xrb, crzb, crxb);
		wzsubv_(& tra1_ .napx, zbb, xbb, cbzb, cbxb);
		i__4 = tra1_ .napx;
		for (j = 1; j <= i__4; ++j) {
		    main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) * cbzb[j 
			    - 1]) * d_sign(&c_b2366, &crkveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130]);
		    main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) * cbxb[j 
			    - 1]) * d_sign(&c_b2366, &cikveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129]);
 
		}
	    }
L490:
	    kpz = (i__4 = ell_ .kp[ix - 1], (( i__4 ) >= 0 ? ( i__4 ) : -( i__4 )) );
	    if (kpz == 0) {
		goto L500;
	    }
	    if (kpz == 1) {
		lostpar2_(&i__, &ix, nthinerr);
		if (*nthinerr != 0) {
		    return 0;
		}
		goto L500;
	    }
	    if (kpz == 3) {
		lostpar3_(&i__, &ix, nthinerr);
		if (*nthinerr != 0) {
		    return 0;
		}
	    }
L500:
	    ;
	}
	lostpart_(nthinerr);
	if (*nthinerr != 0) {
	    return 0;
	}
	if (tra1_ .ntwin != 2) {
	    dist1_();
	}
	if (n % tra1_ .nwr[3] == 0) {
	    write6_(&n);
	}
 
    }
    return 0;
}  

 
 
  int thck6dua_(nthinerr)
integer *nthinerr;
{
     
    integer i__1, i__2, i__3, i__4;
    doublereal d__1, d__2, d__3;

     
    double sin(), sqrt();
    integer s_wsfe(), do_fio(), e_wsfe();
    double exp(), d_sign();

     
    extern   int lostpar2_(), lostpar3_(), writebin_(), 
	    synuthck_(), lostpart_();
    static integer i__, j, k, n;
    static doublereal r0, rb[64];
    static integer ix, jb, jx;
    static doublereal e0o, r2b[64], crkveb[64], cikveb[64], rho2b[64], tkb[64]
	    , rkb[64], xrb[64], zrb[64], xbb[64], zbb[64], crxb[64], crzb[64],
	     cbxb[64], cbzb[64];
    static integer idz1, idz2;
    extern   int ripple_();
    static integer jmel;
    static doublereal puxve1, puzve1, puxve2, puzve2, e0fo;
    extern   int adia_();
    static doublereal crkve, cikve, xlvj, zlvj;
    static integer nmz;
    static doublereal yv1j, yv2j;
    extern   int errf_(), wzsubv_();
    static doublereal crkveuk;
    static integer kpz;
    extern   int dist1_(), write6_();

     
    static cilist io___4271 = { 0, 98, 0, "(1p,6(2x,e25.18))", 0 };


 


 


 
 

 
 

    *nthinerr = 0;
    idz1 = syos_ .idz[0];
    idz2 = syos_ .idz[1];
    i__1 = tra1_ .numl;
    for (n = 1; n <= i__1; ++n) {
	main4_ .numx = n - 1;
	if (ripp_ .irip == 1) {
	    ripple_(&n);
	}
	if (n <= tra1_ .nde[0]) {
	    track_ .nwri = tra1_ .nwr[0];
	}
	if (n > tra1_ .nde[0] && n <= tra1_ .nde[1]) {
	    track_ .nwri = tra1_ .nwr[1];
	}
	if (n > tra1_ .nde[1]) {
	    track_ .nwri = tra1_ .nwr[2];
	}
	if (track_ .nwri == 0) {
	    track_ .nwri = tra1_ .numl + tra1_ .numlr + 1;
	}
	if (main4_ .numx % track_ .nwri == 0) {
	    writebin_(nthinerr);
	}
	if (*nthinerr != 0) {
	    return 0;
	}
	i__2 = str_ .iu;
	for (i__ = 1; i__ <= i__2; ++i__) {
	    if (track_ .ktrack[i__ - 1] == 1) {
		ix = str_ .ic[i__ - 1];
	    } else {
		ix = str_ .ic[i__ - 1] - 300;
	    }
	    switch ((int)(track_ .ktrack[i__ - 1])) {
		case 1:  goto L20;
		case 2:  goto L40;
		case 3:  goto L500;
		case 4:  goto L500;
		case 5:  goto L500;
		case 6:  goto L500;
		case 7:  goto L500;
		case 8:  goto L500;
		case 9:  goto L500;
		case 10:  goto L500;
		case 11:  goto L60;
		case 12:  goto L80;
		case 13:  goto L100;
		case 14:  goto L120;
		case 15:  goto L140;
		case 16:  goto L160;
		case 17:  goto L180;
		case 18:  goto L200;
		case 19:  goto L220;
		case 20:  goto L240;
		case 21:  goto L290;
		case 22:  goto L310;
		case 23:  goto L330;
		case 24:  goto L350;
		case 25:  goto L370;
		case 26:  goto L390;
		case 27:  goto L410;
		case 28:  goto L430;
		case 29:  goto L450;
		case 30:  goto L470;
		case 31:  goto L490;
		case 32:  goto L260;
		case 33:  goto L520;
		case 34:  goto L540;
		case 35:  goto L560;
		case 36:  goto L580;
		case 37:  goto L600;
		case 38:  goto L620;
		case 39:  goto L640;
		case 40:  goto L660;
		case 41:  goto L680;
		case 42:  goto L700;
		case 43:  goto L720;
	    }
	    goto L500;
L20:
	    jmel = str2_ .mel[ix - 1];
	    i__3 = jmel;
	    for (jb = 1; jb <= i__3; ++jb) {
		jx = str2_ .mtyp[ix + jb * 300 - 301];
		i__4 = tra1_ .napx;
		for (j = 1; j <= i__4; ++j) {
		    puxve1 = main1_ .xv[(j << 1) - 2];
		    puzve1 = main1_ .yv[(j << 1) - 2];
		    puxve2 = main1_ .xv[(j << 1) - 1];
		    puzve2 = main1_ .yv[(j << 1) - 1];
		    main1_ .sigmv[j - 1] = main1_ .sigmv[j - 1] + syos_ .as[((
			    j + (jx << 6) << 1) + 1) * 6 - 786] + puxve1 * (
			    syos_ .as[((j + (jx << 6) << 1) + 1) * 6 - 785] + 
			    syos_ .as[((j + (jx << 6) << 1) + 1) * 6 - 783] * 
			    puzve1 + syos_ .as[((j + (jx << 6) << 1) + 1) * 6 
			    - 782] * puxve1) + puzve1 * (syos_ .as[((j + (jx 
			    << 6) << 1) + 1) * 6 - 784] + syos_ .as[((j + (jx 
			    << 6) << 1) + 1) * 6 - 781] * puzve1) + syos_ .as[
			    ((j + (jx << 6) << 1) + 2) * 6 - 786] + puxve2 * (
			    syos_ .as[((j + (jx << 6) << 1) + 2) * 6 - 785] + 
			    syos_ .as[((j + (jx << 6) << 1) + 2) * 6 - 783] * 
			    puzve2 + syos_ .as[((j + (jx << 6) << 1) + 2) * 6 
			    - 782] * puxve2) + puzve2 * (syos_ .as[((j + (jx 
			    << 6) << 1) + 2) * 6 - 784] + syos_ .as[((j + (jx 
			    << 6) << 1) + 2) * 6 - 781] * puzve2);
		    main1_ .xv[(j << 1) - 2] = syos_ .al[((j + (jx << 6) << 1)
			     + 1) * 6 - 786] * puxve1 + syos_ .al[((j + (jx <<
			     6) << 1) + 1) * 6 - 785] * puzve1 + idz1 * 
			    syos_ .al[((j + (jx << 6) << 1) + 1) * 6 - 782];
		    main1_ .xv[(j << 1) - 1] = syos_ .al[((j + (jx << 6) << 1)
			     + 2) * 6 - 786] * puxve2 + syos_ .al[((j + (jx <<
			     6) << 1) + 2) * 6 - 785] * puzve2 + idz2 * 
			    syos_ .al[((j + (jx << 6) << 1) + 2) * 6 - 782];
		    main1_ .yv[(j << 1) - 2] = syos_ .al[((j + (jx << 6) << 1)
			     + 1) * 6 - 784] * puxve1 + syos_ .al[((j + (jx <<
			     6) << 1) + 1) * 6 - 783] * puzve1 + idz1 * 
			    syos_ .al[((j + (jx << 6) << 1) + 1) * 6 - 781];
		    main1_ .yv[(j << 1) - 1] = syos_ .al[((j + (jx << 6) << 1)
			     + 2) * 6 - 784] * puxve2 + syos_ .al[((j + (jx <<
			     6) << 1) + 2) * 6 - 783] * puzve2 + idz2 * 
			    syos_ .al[((j + (jx << 6) << 1) + 2) * 6 - 781];
 
		}
	    }
	    goto L500;
L40:
	    e0o = syn_ .e0;
	    e0fo = main4_ .e0f;
	    adia_(&n, & main4_ .e0f);
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .ejf0v[j - 1] = main1_ .ejfv[j - 1];
		if ((( syn_ .dppoff ) >= 0 ? ( syn_ .dppoff ) : -( syn_ .dppoff ))  > 1e-17) {
		    main1_ .sigmv[j - 1] -= syn_ .sigmoff[i__ - 1];
		}
		if (main1_ .sigmv[j - 1] < 0.) {
		    main1_ .sigmv[j - 1] = main4_ .e0f * e0o / (e0fo * 
			    syn_ .e0) * main1_ .sigmv[j - 1];
		}
		if (ell_ .kz[ix - 1] == 12) {
		    main1_ .ejv[j - 1] += ell_ .ed[ix - 1] * sin(syn_ .hsyc[
			    ix - 1] * main1_ .sigmv[j - 1] + syn_ .phas + 
			    syn_ .phasc[ix - 1]);
		} else {
		    main1_ .ejv[j - 1] += syn_ .hsy[0] * sin(syn_ .hsy[2] * 
			    main1_ .sigmv[j - 1] + syn_ .phas);
		}
		main1_ .ejfv[j - 1] = sqrt(main1_ .ejv[j - 1] * main1_ .ejv[j 
			- 1] - syn_ .pma * syn_ .pma);
		main1_ .rvv[j - 1] = main1_ .ejv[j - 1] / syn_ .e0 * 
			main4_ .e0f / main1_ .ejfv[j - 1];
		main1_ .dpsv[j - 1] = (main1_ .ejfv[j - 1] - main4_ .e0f) / 
			main4_ .e0f;
		main2_ .oidpsv[j - 1] = 1. / (main1_ .dpsv[j - 1] + 1.);
		track_ .dpsv1[j - 1] = main1_ .dpsv[j - 1] * 1e3 * 
			main2_ .oidpsv[j - 1];
		if (main1_ .sigmv[j - 1] > 0.) {
		    main1_ .sigmv[j - 1] = main4_ .e0f * e0o / (e0fo * 
			    syn_ .e0) * main1_ .sigmv[j - 1];
		}
		main1_ .yv[(j << 1) - 2] = main1_ .ejf0v[j - 1] / 
			main1_ .ejfv[j - 1] * main1_ .yv[(j << 1) - 2];
 
		main1_ .yv[(j << 1) - 1] = main1_ .ejf0v[j - 1] / 
			main1_ .ejfv[j - 1] * main1_ .yv[(j << 1) - 1];
	    }
	    if (n == 1) {
		s_wsfe(&io___4271);
		i__4 = tra1_ .napx;
		for (j = 1; j <= i__4; ++j) {
		    do_fio(&c__1, (char *)& main1_ .xv[(j << 1) - 2], (ftnlen)
			    sizeof(doublereal));
		    d__1 = main1_ .yv[(j << 1) - 2] * (main1_ .dpsv[j - 1] + 
			    1.);
		    do_fio(&c__1, (char *)&d__1, (ftnlen)sizeof(doublereal));
		    do_fio(&c__1, (char *)& main1_ .xv[(j << 1) - 1], (ftnlen)
			    sizeof(doublereal));
		    d__2 = main1_ .yv[(j << 1) - 1] * (main1_ .dpsv[j - 1] + 
			    1.);
		    do_fio(&c__1, (char *)&d__2, (ftnlen)sizeof(doublereal));
		    do_fio(&c__1, (char *)& main1_ .sigmv[j - 1], (ftnlen)
			    sizeof(doublereal));
		    d__3 = main1_ .dpsv[j - 1] * 1e3;
		    do_fio(&c__1, (char *)&d__3, (ftnlen)sizeof(doublereal));
		}
		e_wsfe();
	    }
	    synuthck_();
	    goto L490;
 
L60:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .yv[(j << 1) - 2] += track_ .strackc[i__ - 1] * 
			main2_ .oidpsv[j - 1];
		main1_ .yv[(j << 1) - 1] += track_ .stracks[i__ - 1] * 
			main2_ .oidpsv[j - 1];
 
	    }
	    goto L490;
 
L80:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L490;
 
L100:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L490;
 
L120:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L490;
 
L140:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L490;
 
L160:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L490;
 
L180:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L490;
 
L200:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L490;
 
L220:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L490;
 
L240:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L490;
L520:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - (
			track_ .strack[i__ - 1] * xlvj * main2_ .oidpsv[j - 1]
			 + track_ .dpsv1[j - 1]) * dkic_ .dki[ix - 1] * 
			rand1_ .tiltc[i__ - 1] + dkic_ .dki[ix - 1] * 1e3 * 
			main2_ .oidpsv[j - 1] * (1. - rand1_ .tiltc[i__ - 1]);
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - (
			track_ .strack[i__ - 1] * xlvj * main2_ .oidpsv[j - 1]
			 + track_ .dpsv1[j - 1]) * dkic_ .dki[ix - 1] * 
			rand1_ .tilts[i__ - 1] + dkic_ .dki[ix - 1] * 1e3 * 
			main2_ .oidpsv[j - 1] * rand1_ .tilts[i__ - 1];
		main1_ .sigmv[j - 1] += main1_ .rvv[j - 1] * dkic_ .dki[ix - 
			1] * xlvj;
 
	    }
	    goto L490;
L540:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - (
			track_ .strack[i__ - 1] * xlvj * main2_ .oidpsv[j - 1]
			 + track_ .dpsv1[j - 1]) * dkic_ .dki[ix - 1] * 
			rand1_ .tiltc[i__ - 1] + dkic_ .dki[ix - 1] * 1e3 * 
			main2_ .oidpsv[j - 1] * (1. - rand1_ .tiltc[i__ - 1]);
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - (
			track_ .strack[i__ - 1] * xlvj * main2_ .oidpsv[j - 1]
			 + track_ .dpsv1[j - 1]) * dkic_ .dki[ix - 1] * 
			rand1_ .tilts[i__ - 1] + dkic_ .dki[ix - 1] * 1e3 * 
			main2_ .oidpsv[j - 1] * rand1_ .tilts[i__ - 1];
		main1_ .sigmv[j - 1] += main1_ .rvv[j - 1] * dkic_ .dki[ix - 
			1] * xlvj;
 
	    }
	    goto L260;
L560:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - 
			track_ .strackc[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix - 1] * 1e3 * main2_ .oidpsv[j - 1] * (
			1. - rand1_ .tiltc[i__ - 1]);
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - 
			track_ .stracks[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix - 1] * 1e3 * main2_ .oidpsv[j - 1] * 
			rand1_ .tilts[i__ - 1];
		main1_ .sigmv[j - 1] += main1_ .rvv[j - 1] * dkic_ .dki[ix - 
			1] * xlvj;
 
	    }
	    goto L490;
L580:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - 
			track_ .strackc[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix - 1] * 1e3 * main2_ .oidpsv[j - 1] * (
			1. - rand1_ .tiltc[i__ - 1]);
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - 
			track_ .stracks[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix - 1] * 1e3 * main2_ .oidpsv[j - 1] * 
			rand1_ .tilts[i__ - 1];
		main1_ .sigmv[j - 1] += main1_ .rvv[j - 1] * dkic_ .dki[ix - 
			1] * xlvj;
 
	    }
	    goto L260;
L600:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] + (
			track_ .strack[i__ - 1] * zlvj * main2_ .oidpsv[j - 1]
			 - track_ .dpsv1[j - 1]) * dkic_ .dki[ix + 699] * 
			rand1_ .tilts[i__ - 1] + dkic_ .dki[ix + 699] * 1e3 * 
			main2_ .oidpsv[j - 1] * rand1_ .tilts[i__ - 1];
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - (
			track_ .strack[i__ - 1] * zlvj * main2_ .oidpsv[j - 1]
			 - track_ .dpsv1[j - 1]) * dkic_ .dki[ix + 699] * 
			rand1_ .tiltc[i__ - 1] - dkic_ .dki[ix + 699] * 1e3 * 
			main2_ .oidpsv[j - 1] * (1. - rand1_ .tiltc[i__ - 1]);
		main1_ .sigmv[j - 1] -= main1_ .rvv[j - 1] * dkic_ .dki[ix + 
			699] * zlvj;
 
	    }
	    goto L490;
L620:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] + (
			track_ .strack[i__ - 1] * zlvj * main2_ .oidpsv[j - 1]
			 - track_ .dpsv1[j - 1]) * dkic_ .dki[ix + 699] * 
			rand1_ .tilts[i__ - 1] + dkic_ .dki[ix + 699] * 1e3 * 
			main2_ .oidpsv[j - 1] * rand1_ .tilts[i__ - 1];
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - (
			track_ .strack[i__ - 1] * zlvj * main2_ .oidpsv[j - 1]
			 - track_ .dpsv1[j - 1]) * dkic_ .dki[ix + 699] * 
			rand1_ .tiltc[i__ - 1] - dkic_ .dki[ix + 699] * 1e3 * 
			main2_ .oidpsv[j - 1] * (1. - rand1_ .tiltc[i__ - 1]);
		main1_ .sigmv[j - 1] -= main1_ .rvv[j - 1] * dkic_ .dki[ix + 
			699] * zlvj;
 
	    }
	    goto L260;
L640:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - 
			track_ .stracks[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix + 699] * 1e3 * main2_ .oidpsv[j - 1] * 
			rand1_ .tilts[i__ - 1];
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] + 
			track_ .strackc[i__ - 1] * track_ .dpsv1[j - 1] - 
			dkic_ .dki[ix + 699] * 1e3 * main2_ .oidpsv[j - 1] * (
			1. - rand1_ .tiltc[i__ - 1]);
		main1_ .sigmv[j - 1] -= main1_ .rvv[j - 1] * dkic_ .dki[ix + 
			699] * zlvj;
 
	    }
	    goto L490;
L660:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - 
			track_ .stracks[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix + 699] * 1e3 * main2_ .oidpsv[j - 1] * 
			rand1_ .tilts[i__ - 1];
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] + 
			track_ .strackc[i__ - 1] * track_ .dpsv1[j - 1] - 
			dkic_ .dki[ix + 699] * 1e3 * main2_ .oidpsv[j - 1] * (
			1. - rand1_ .tiltc[i__ - 1]);
		main1_ .sigmv[j - 1] -= main1_ .rvv[j - 1] * dkic_ .dki[ix + 
			699] * zlvj;
 
	    }
L260:
	    r0 = ell_ .ek[ix - 1];
	    nmz = mult1_ .nmu[ix - 1];
	    if (nmz >= 2) {
		i__4 = tra1_ .napx;
		for (j = 1; j <= i__4; ++j) {
		    xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) 
			    * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 
			    1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 
			    1];
		    zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1])
			     * rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) 
			    - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ 
			    - 1];
		    yv1j = main1_ .bbiv[(i__ + 1) * 11 - 22] + main1_ .bbiv[(
			    i__ + 1) * 11 - 21] * xlvj + main1_ .aaiv[(i__ + 
			    1) * 11 - 21] * zlvj;
		    yv2j = main1_ .aaiv[(i__ + 1) * 11 - 22] - main1_ .bbiv[(
			    i__ + 1) * 11 - 21] * zlvj + main1_ .aaiv[(i__ + 
			    1) * 11 - 21] * xlvj;
		    crkve = xlvj;
		    cikve = zlvj;
		    i__3 = nmz;
		    for (k = 3; k <= i__3; ++k) {
			crkveuk = crkve * xlvj - cikve * zlvj;
			cikve = crkve * zlvj + cikve * xlvj;
			crkve = crkveuk;
			yv1j = yv1j + main1_ .bbiv[k + (i__ + 1) * 11 - 23] * 
				crkve + main1_ .aaiv[k + (i__ + 1) * 11 - 23] 
				* cikve;
			yv2j = yv2j - main1_ .bbiv[k + (i__ + 1) * 11 - 23] * 
				cikve + main1_ .aaiv[k + (i__ + 1) * 11 - 23] 
				* crkve;
 
		    }
		    main1_ .yv[(j << 1) - 2] += (rand1_ .tiltc[i__ - 1] * 
			    yv1j - rand1_ .tilts[i__ - 1] * yv2j) * 
			    main2_ .oidpsv[j - 1];
		    main1_ .yv[(j << 1) - 1] += (rand1_ .tiltc[i__ - 1] * 
			    yv2j + rand1_ .tilts[i__ - 1] * yv1j) * 
			    main2_ .oidpsv[j - 1];
 
		}
	    } else {
		i__4 = tra1_ .napx;
		for (j = 1; j <= i__4; ++j) {
		    main1_ .yv[(j << 1) - 2] += (rand1_ .tiltc[i__ - 1] * 
			    main1_ .bbiv[(i__ + 1) * 11 - 22] - rand1_ .tilts[
			    i__ - 1] * main1_ .aaiv[(i__ + 1) * 11 - 22]) * 
			    main2_ .oidpsv[j - 1];
		    main1_ .yv[(j << 1) - 1] += (rand1_ .tiltc[i__ - 1] * 
			    main1_ .aaiv[(i__ + 1) * 11 - 22] + rand1_ .tilts[
			    i__ - 1] * main1_ .bbiv[(i__ + 1) * 11 - 22]) * 
			    main2_ .oidpsv[j - 1];
 
		}
	    }
	    goto L490;
 
 
L290:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .yv[(j << 1) - 2] -= track_ .stracks[i__ - 1] * 
			main2_ .oidpsv[j - 1];
		main1_ .yv[(j << 1) - 1] += track_ .strackc[i__ - 1] * 
			main2_ .oidpsv[j - 1];
 
	    }
	    goto L490;
 
L310:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L490;
 
L330:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L490;
 
L350:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L490;
 
L370:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L490;
 
L390:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L490;
 
L410:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L490;
 
L430:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L490;
 
L450:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L490;
 
L470:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L490;
L680:
	    i__4 = tra1_ .napx;
	    for (j = 1; j <= i__4; ++j) {
		crkveb[j - 1] = main1_ .xv[(j << 1) - 2] - beam_ .clobeam[(j 
			+ (ix << 6) << 1) - 130] + ell_ .ed[ix - 1];
		cikveb[j - 1] = main1_ .xv[(j << 1) - 1] - beam_ .clobeam[(j 
			+ (ix << 6) << 1) - 129] + ell_ .ek[ix - 1];
		rho2b[j - 1] = crkveb[j - 1] * crkveb[j - 1] + cikveb[j - 1] *
			 cikveb[j - 1];
		if (rho2b[j - 1] <= 1e-17) {
		    goto L690;
		}
		tkb[j - 1] = rho2b[j - 1] / (beam_ .sigman2[(j + (ix << 6) << 
			1) - 130] * 2.);
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strack[i__ - 1] * crkveb[j - 1] / rho2b[j - 1]
			 * (1. - exp(-tkb[j - 1])) - beam_ .beamoff[(j + (ix 
			<< 6) << 1) - 130]);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strack[i__ - 1] * cikveb[j - 1] / rho2b[j - 1]
			 * (1. - exp(-tkb[j - 1])) - beam_ .beamoff[(j + (ix 
			<< 6) << 1) - 129]);
L690:
		;
	    }
	    goto L490;
L700:
	    if (beam_ .ibtyp == 0) {
		i__4 = tra1_ .napx;
		for (j = 1; j <= i__4; ++j) {
		    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) - 130] 
			    - beam_ .sigman2[(j + (ix << 6) << 1) - 129]) * 
			    2.;
		    rb[j - 1] = sqrt(r2b[j - 1]);
		    rkb[j - 1] = track_ .strack[i__ - 1] * kons_ .pisqrt / rb[
			    j - 1];
		    crkveb[j - 1] = main1_ .xv[(j << 1) - 2] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 130] + ell_ .ed[ix - 1];
		    cikveb[j - 1] = main1_ .xv[(j << 1) - 1] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 129] + ell_ .ek[ix - 1];
		    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    errf_(&xrb[j - 1], &zrb[j - 1], &crxb[j - 1], &crzb[j - 1]
			    );
		    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
			    beam_ .sigman2[(j + (ix << 6) << 1) - 130] + 
			    cikveb[j - 1] * cikveb[j - 1] / beam_ .sigman2[(j 
			    + (ix << 6) << 1) - 129]) / 2.;
		    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 129] * 
			    xrb[j - 1];
		    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 130] * 
			    zrb[j - 1];
		    errf_(&xbb[j - 1], &zbb[j - 1], &cbxb[j - 1], &cbzb[j - 1]
			    );
		    main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) * cbzb[j 
			    - 1]) * d_sign(&c_b2366, &crkveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130]);
		    main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) * cbxb[j 
			    - 1]) * d_sign(&c_b2366, &cikveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129]);
 
		}
	    } else if (beam_ .ibtyp == 1) {
		i__4 = tra1_ .napx;
		for (j = 1; j <= i__4; ++j) {
		    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) - 130] 
			    - beam_ .sigman2[(j + (ix << 6) << 1) - 129]) * 
			    2.;
		    rb[j - 1] = sqrt(r2b[j - 1]);
		    rkb[j - 1] = track_ .strack[i__ - 1] * kons_ .pisqrt / rb[
			    j - 1];
		    crkveb[j - 1] = main1_ .xv[(j << 1) - 2] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 130] + ell_ .ed[ix - 1];
		    cikveb[j - 1] = main1_ .xv[(j << 1) - 1] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 129] + ell_ .ek[ix - 1];
		    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
			    beam_ .sigman2[(j + (ix << 6) << 1) - 130] + 
			    cikveb[j - 1] * cikveb[j - 1] / beam_ .sigman2[(j 
			    + (ix << 6) << 1) - 129]) / 2.;
		    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 129] * 
			    xrb[j - 1];
		    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 130] * 
			    zrb[j - 1];
 
		}
		wzsubv_(& tra1_ .napx, xrb, zrb, crxb, crzb);
		wzsubv_(& tra1_ .napx, xbb, zbb, cbxb, cbzb);
		i__4 = tra1_ .napx;
		for (j = 1; j <= i__4; ++j) {
		    main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) * cbzb[j 
			    - 1]) * d_sign(&c_b2366, &crkveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130]);
		    main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) * cbxb[j 
			    - 1]) * d_sign(&c_b2366, &cikveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129]);
 
		}
	    }
	    goto L490;
L720:
	    if (beam_ .ibtyp == 0) {
		i__4 = tra1_ .napx;
		for (j = 1; j <= i__4; ++j) {
		    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) - 129] 
			    - beam_ .sigman2[(j + (ix << 6) << 1) - 130]) * 
			    2.;
		    rb[j - 1] = sqrt(r2b[j - 1]);
		    rkb[j - 1] = track_ .strack[i__ - 1] * kons_ .pisqrt / rb[
			    j - 1];
		    crkveb[j - 1] = main1_ .xv[(j << 1) - 2] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 130] + ell_ .ed[ix - 1];
		    cikveb[j - 1] = main1_ .xv[(j << 1) - 1] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 129] + ell_ .ek[ix - 1];
		    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    errf_(&zrb[j - 1], &xrb[j - 1], &crzb[j - 1], &crxb[j - 1]
			    );
		    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
			    beam_ .sigman2[(j + (ix << 6) << 1) - 130] + 
			    cikveb[j - 1] * cikveb[j - 1] / beam_ .sigman2[(j 
			    + (ix << 6) << 1) - 129]) / 2.;
		    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 129] * 
			    xrb[j - 1];
		    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 130] * 
			    zrb[j - 1];
		    errf_(&zbb[j - 1], &xbb[j - 1], &cbzb[j - 1], &cbxb[j - 1]
			    );
		    main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) * cbzb[j 
			    - 1]) * d_sign(&c_b2366, &crkveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130]);
		    main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) * cbxb[j 
			    - 1]) * d_sign(&c_b2366, &cikveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129]);
 
		}
	    } else if (beam_ .ibtyp == 1) {
		i__4 = tra1_ .napx;
		for (j = 1; j <= i__4; ++j) {
		    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) - 129] 
			    - beam_ .sigman2[(j + (ix << 6) << 1) - 130]) * 
			    2.;
		    rb[j - 1] = sqrt(r2b[j - 1]);
		    rkb[j - 1] = track_ .strack[i__ - 1] * kons_ .pisqrt / rb[
			    j - 1];
		    crkveb[j - 1] = main1_ .xv[(j << 1) - 2] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 130] + ell_ .ed[ix - 1];
		    cikveb[j - 1] = main1_ .xv[(j << 1) - 1] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 129] + ell_ .ek[ix - 1];
		    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
			    beam_ .sigman2[(j + (ix << 6) << 1) - 130] + 
			    cikveb[j - 1] * cikveb[j - 1] / beam_ .sigman2[(j 
			    + (ix << 6) << 1) - 129]) / 2.;
		    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 129] * 
			    xrb[j - 1];
		    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 130] * 
			    zrb[j - 1];
 
		}
		wzsubv_(& tra1_ .napx, zrb, xrb, crzb, crxb);
		wzsubv_(& tra1_ .napx, zbb, xbb, cbzb, cbxb);
		i__4 = tra1_ .napx;
		for (j = 1; j <= i__4; ++j) {
		    main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) * cbzb[j 
			    - 1]) * d_sign(&c_b2366, &crkveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130]);
		    main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) * cbxb[j 
			    - 1]) * d_sign(&c_b2366, &cikveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129]);
 
		}
	    }
L490:
	    kpz = (i__4 = ell_ .kp[ix - 1], (( i__4 ) >= 0 ? ( i__4 ) : -( i__4 )) );
	    if (kpz == 0) {
		goto L500;
	    }
	    if (kpz == 1) {
		lostpar2_(&i__, &ix, nthinerr);
		if (*nthinerr != 0) {
		    return 0;
		}
		goto L500;
	    }
	    if (kpz == 3) {
		lostpar3_(&i__, &ix, nthinerr);
		if (*nthinerr != 0) {
		    return 0;
		}
	    }
L500:
	    ;
	}
	lostpart_(nthinerr);
	if (*nthinerr != 0) {
	    return 0;
	}
	if (tra1_ .ntwin != 2) {
	    dist1_();
	}
	if (n % tra1_ .nwr[3] == 0) {
	    write6_(&n);
	}
 
    }
    return 0;
}  

 
 
  int thin4d_(nthinerr)
integer *nthinerr;
{
     
    integer i__1, i__2, i__3, i__4;
    doublereal d__1;

     
    double exp(), sqrt(), d_sign();

     
    extern   int lostpar2_(), lostpar3_(), writebin_(), 
	    lostpart_();
    static integer i__, j, k, n;
    static doublereal r0, rb[64];
    static integer ix;
    static doublereal r2b[64], crkveb[64], cikveb[64], rho2b[64], tkb[64], 
	    rkb[64], xrb[64], zrb[64], xbb[64], zbb[64], crxb[64], crzb[64], 
	    cbxb[64], cbzb[64];
    extern   int ripple_();
    static doublereal crkve, cikve, xlvj, zlvj;
    static integer nmz;
    static doublereal yv1j, yv2j;
    extern   int errf_(), wzsubv_();
    static integer kpz;
    static doublereal stracki;
    extern   int dist1_(), write6_();
    static doublereal crkveuk;

 


 


 
 

 
 

    *nthinerr = 0;
    i__1 = tra1_ .numl;
    for (n = 1; n <= i__1; ++n) {
	main4_ .numx = n - 1;
	if (ripp_ .irip == 1) {
	    ripple_(&n);
	}
	if (main4_ .numx % track_ .nwri == 0) {
	    writebin_(nthinerr);
	}
	if (*nthinerr != 0) {
	    return 0;
	}
	i__2 = str_ .iu;
	for (i__ = 1; i__ <= i__2; ++i__) {
	    ix = str_ .ic[i__ - 1] - 300;
	    switch ((int)(track_ .ktrack[i__ - 1])) {
		case 1:  goto L10;
		case 2:  goto L630;
		case 3:  goto L630;
		case 4:  goto L630;
		case 5:  goto L630;
		case 6:  goto L630;
		case 7:  goto L630;
		case 8:  goto L630;
		case 9:  goto L630;
		case 10:  goto L630;
		case 11:  goto L30;
		case 12:  goto L50;
		case 13:  goto L70;
		case 14:  goto L90;
		case 15:  goto L110;
		case 16:  goto L130;
		case 17:  goto L150;
		case 18:  goto L170;
		case 19:  goto L190;
		case 20:  goto L210;
		case 21:  goto L420;
		case 22:  goto L440;
		case 23:  goto L460;
		case 24:  goto L480;
		case 25:  goto L500;
		case 26:  goto L520;
		case 27:  goto L540;
		case 28:  goto L560;
		case 29:  goto L580;
		case 30:  goto L600;
		case 31:  goto L620;
		case 32:  goto L390;
		case 33:  goto L230;
		case 34:  goto L250;
		case 35:  goto L270;
		case 36:  goto L290;
		case 37:  goto L310;
		case 38:  goto L330;
		case 39:  goto L350;
		case 40:  goto L370;
		case 41:  goto L680;
		case 42:  goto L700;
		case 43:  goto L720;
	    }
	    goto L630;
L10:
	    stracki = track_ .strack[i__ - 1];
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xv[(j << 1) - 2] += stracki * main1_ .yv[(j << 1) - 2]
			;
		main1_ .xv[(j << 1) - 1] += stracki * main1_ .yv[(j << 1) - 1]
			;
 
	    }
	    goto L630;
 
L30:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .yv[(j << 1) - 2] += track_ .strackc[i__ - 1] * 
			main2_ .oidpsv[j - 1];
		main1_ .yv[(j << 1) - 1] += track_ .stracks[i__ - 1] * 
			main2_ .oidpsv[j - 1];
 
	    }
	    goto L620;
 
L50:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L620;
 
L70:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L620;
 
L90:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L620;
 
L110:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L620;
 
L130:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L620;
 
L150:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L620;
 
L170:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L620;
 
L190:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L620;
 
L210:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L620;
L230:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - (
			track_ .strack[i__ - 1] * xlvj * main2_ .oidpsv[j - 1]
			 + track_ .dpsv1[j - 1]) * dkic_ .dki[ix - 1] * 
			rand1_ .tiltc[i__ - 1] + dkic_ .dki[ix - 1] * 1e3 * 
			main2_ .oidpsv[j - 1] * (1. - rand1_ .tiltc[i__ - 1]);
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - (
			track_ .strack[i__ - 1] * xlvj * main2_ .oidpsv[j - 1]
			 + track_ .dpsv1[j - 1]) * dkic_ .dki[ix - 1] * 
			rand1_ .tilts[i__ - 1] + dkic_ .dki[ix - 1] * 1e3 * 
			main2_ .oidpsv[j - 1] * rand1_ .tilts[i__ - 1];
 
	    }
	    goto L620;
L250:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - (
			track_ .strack[i__ - 1] * xlvj * main2_ .oidpsv[j - 1]
			 + track_ .dpsv1[j - 1]) * dkic_ .dki[ix - 1] * 
			rand1_ .tiltc[i__ - 1] + dkic_ .dki[ix - 1] * 1e3 * 
			main2_ .oidpsv[j - 1] * (1. - rand1_ .tiltc[i__ - 1]);
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - (
			track_ .strack[i__ - 1] * xlvj * main2_ .oidpsv[j - 1]
			 + track_ .dpsv1[j - 1]) * dkic_ .dki[ix - 1] * 
			rand1_ .tilts[i__ - 1] + dkic_ .dki[ix - 1] * 1e3 * 
			main2_ .oidpsv[j - 1] * rand1_ .tilts[i__ - 1];
 
	    }
	    goto L390;
L270:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - 
			track_ .strackc[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix - 1] * 1e3 * main2_ .oidpsv[j - 1] * (
			1. - rand1_ .tiltc[i__ - 1]);
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - 
			track_ .stracks[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix - 1] * 1e3 * main2_ .oidpsv[j - 1] * 
			rand1_ .tilts[i__ - 1];
 
	    }
	    goto L620;
L290:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - 
			track_ .strackc[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix - 1] * 1e3 * main2_ .oidpsv[j - 1] * (
			1. - rand1_ .tiltc[i__ - 1]);
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - 
			track_ .stracks[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix - 1] * 1e3 * main2_ .oidpsv[j - 1] * 
			rand1_ .tilts[i__ - 1];
 
	    }
	    goto L390;
L310:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] + (
			track_ .strack[i__ - 1] * zlvj * main2_ .oidpsv[j - 1]
			 - track_ .dpsv1[j - 1]) * dkic_ .dki[ix + 699] * 
			rand1_ .tilts[i__ - 1] + dkic_ .dki[ix + 699] * 1e3 * 
			main2_ .oidpsv[j - 1] * rand1_ .tilts[i__ - 1];
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - (
			track_ .strack[i__ - 1] * zlvj * main2_ .oidpsv[j - 1]
			 - track_ .dpsv1[j - 1]) * dkic_ .dki[ix + 699] * 
			rand1_ .tiltc[i__ - 1] - dkic_ .dki[ix + 699] * 1e3 * 
			main2_ .oidpsv[j - 1] * (1. - rand1_ .tiltc[i__ - 1]);
 
	    }
	    goto L620;
L330:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] + (
			track_ .strack[i__ - 1] * zlvj * main2_ .oidpsv[j - 1]
			 - track_ .dpsv1[j - 1]) * dkic_ .dki[ix + 699] * 
			rand1_ .tilts[i__ - 1] + dkic_ .dki[ix + 699] * 1e3 * 
			main2_ .oidpsv[j - 1] * rand1_ .tilts[i__ - 1];
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - (
			track_ .strack[i__ - 1] * zlvj * main2_ .oidpsv[j - 1]
			 - track_ .dpsv1[j - 1]) * dkic_ .dki[ix + 699] * 
			rand1_ .tiltc[i__ - 1] - dkic_ .dki[ix + 699] * 1e3 * 
			main2_ .oidpsv[j - 1] * (1. - rand1_ .tiltc[i__ - 1]);
 
	    }
	    goto L390;
L350:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - 
			track_ .stracks[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix + 699] * 1e3 * main2_ .oidpsv[j - 1] * 
			rand1_ .tilts[i__ - 1];
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] + 
			track_ .strackc[i__ - 1] * track_ .dpsv1[j - 1] - 
			dkic_ .dki[ix + 699] * 1e3 * main2_ .oidpsv[j - 1] * (
			1. - rand1_ .tiltc[i__ - 1]);
 
	    }
	    goto L620;
L370:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - 
			track_ .stracks[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix + 699] * 1e3 * main2_ .oidpsv[j - 1] * 
			rand1_ .tilts[i__ - 1];
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] + 
			track_ .strackc[i__ - 1] * track_ .dpsv1[j - 1] - 
			dkic_ .dki[ix + 699] * 1e3 * main2_ .oidpsv[j - 1] * (
			1. - rand1_ .tiltc[i__ - 1]);
 
	    }
L390:
	    r0 = ell_ .ek[ix - 1];
	    nmz = mult1_ .nmu[ix - 1];
	    if (nmz >= 2) {
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) 
			    * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 
			    1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 
			    1];
		    zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1])
			     * rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) 
			    - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ 
			    - 1];
		    yv1j = main1_ .bbiv[(i__ + 1) * 11 - 22] + main1_ .bbiv[(
			    i__ + 1) * 11 - 21] * xlvj + main1_ .aaiv[(i__ + 
			    1) * 11 - 21] * zlvj;
		    yv2j = main1_ .aaiv[(i__ + 1) * 11 - 22] - main1_ .bbiv[(
			    i__ + 1) * 11 - 21] * zlvj + main1_ .aaiv[(i__ + 
			    1) * 11 - 21] * xlvj;
		    crkve = xlvj;
		    cikve = zlvj;
		    i__4 = nmz;
		    for (k = 3; k <= i__4; ++k) {
			crkveuk = crkve * xlvj - cikve * zlvj;
			cikve = crkve * zlvj + cikve * xlvj;
			crkve = crkveuk;
			yv1j = yv1j + main1_ .bbiv[k + (i__ + 1) * 11 - 23] * 
				crkve + main1_ .aaiv[k + (i__ + 1) * 11 - 23] 
				* cikve;
			yv2j = yv2j - main1_ .bbiv[k + (i__ + 1) * 11 - 23] * 
				cikve + main1_ .aaiv[k + (i__ + 1) * 11 - 23] 
				* crkve;
 
		    }
		    main1_ .yv[(j << 1) - 2] += (rand1_ .tiltc[i__ - 1] * 
			    yv1j - rand1_ .tilts[i__ - 1] * yv2j) * 
			    main2_ .oidpsv[j - 1];
		    main1_ .yv[(j << 1) - 1] += (rand1_ .tiltc[i__ - 1] * 
			    yv2j + rand1_ .tilts[i__ - 1] * yv1j) * 
			    main2_ .oidpsv[j - 1];
 
		}
	    } else {
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    main1_ .yv[(j << 1) - 2] += (rand1_ .tiltc[i__ - 1] * 
			    main1_ .bbiv[(i__ + 1) * 11 - 22] - rand1_ .tilts[
			    i__ - 1] * main1_ .aaiv[(i__ + 1) * 11 - 22]) * 
			    main2_ .oidpsv[j - 1];
		    main1_ .yv[(j << 1) - 1] += (rand1_ .tiltc[i__ - 1] * 
			    main1_ .aaiv[(i__ + 1) * 11 - 22] + rand1_ .tilts[
			    i__ - 1] * main1_ .bbiv[(i__ + 1) * 11 - 22]) * 
			    main2_ .oidpsv[j - 1];
 
		}
	    }
	    goto L620;
 
 
L420:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .yv[(j << 1) - 2] -= track_ .stracks[i__ - 1] * 
			main2_ .oidpsv[j - 1];
		main1_ .yv[(j << 1) - 1] += track_ .strackc[i__ - 1] * 
			main2_ .oidpsv[j - 1];
 
	    }
	    goto L620;
 
L440:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L620;
 
L460:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L620;
 
L480:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L620;
 
L500:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L620;
 
L520:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L620;
 
L540:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L620;
 
L560:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L620;
 
L580:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L620;
 
L600:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L620;
L680:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		crkveb[j - 1] = main1_ .xv[(j << 1) - 2] - beam_ .clobeam[(j 
			+ (ix << 6) << 1) - 130] + ell_ .ed[ix - 1];
		cikveb[j - 1] = main1_ .xv[(j << 1) - 1] - beam_ .clobeam[(j 
			+ (ix << 6) << 1) - 129] + ell_ .ek[ix - 1];
		rho2b[j - 1] = crkveb[j - 1] * crkveb[j - 1] + cikveb[j - 1] *
			 cikveb[j - 1];
		if (rho2b[j - 1] <= 1e-17) {
		    goto L690;
		}
		tkb[j - 1] = rho2b[j - 1] / (beam_ .sigman2[(j + (ix << 6) << 
			1) - 130] * 2.);
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strack[i__ - 1] * crkveb[j - 1] / rho2b[j - 1]
			 * (1. - exp(-tkb[j - 1])) - beam_ .beamoff[(j + (ix 
			<< 6) << 1) - 130]);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strack[i__ - 1] * cikveb[j - 1] / rho2b[j - 1]
			 * (1. - exp(-tkb[j - 1])) - beam_ .beamoff[(j + (ix 
			<< 6) << 1) - 129]);
L690:
		;
	    }
	    goto L620;
L700:
	    if (beam_ .ibtyp == 0) {
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) - 130] 
			    - beam_ .sigman2[(j + (ix << 6) << 1) - 129]) * 
			    2.;
		    rb[j - 1] = sqrt(r2b[j - 1]);
		    rkb[j - 1] = track_ .strack[i__ - 1] * kons_ .pisqrt / rb[
			    j - 1];
		    crkveb[j - 1] = main1_ .xv[(j << 1) - 2] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 130] + ell_ .ed[ix - 1];
		    cikveb[j - 1] = main1_ .xv[(j << 1) - 1] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 129] + ell_ .ek[ix - 1];
		    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    errf_(&xrb[j - 1], &zrb[j - 1], &crxb[j - 1], &crzb[j - 1]
			    );
		    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
			    beam_ .sigman2[(j + (ix << 6) << 1) - 130] + 
			    cikveb[j - 1] * cikveb[j - 1] / beam_ .sigman2[(j 
			    + (ix << 6) << 1) - 129]) / 2.;
		    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 129] * 
			    xrb[j - 1];
		    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 130] * 
			    zrb[j - 1];
		    errf_(&xbb[j - 1], &zbb[j - 1], &cbxb[j - 1], &cbzb[j - 1]
			    );
		    main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) * cbzb[j 
			    - 1]) * d_sign(&c_b2366, &crkveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130]);
		    main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) * cbxb[j 
			    - 1]) * d_sign(&c_b2366, &cikveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129]);
 
		}
	    } else if (beam_ .ibtyp == 1) {
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) - 130] 
			    - beam_ .sigman2[(j + (ix << 6) << 1) - 129]) * 
			    2.;
		    rb[j - 1] = sqrt(r2b[j - 1]);
		    rkb[j - 1] = track_ .strack[i__ - 1] * kons_ .pisqrt / rb[
			    j - 1];
		    crkveb[j - 1] = main1_ .xv[(j << 1) - 2] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 130] + ell_ .ed[ix - 1];
		    cikveb[j - 1] = main1_ .xv[(j << 1) - 1] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 129] + ell_ .ek[ix - 1];
		    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
			    beam_ .sigman2[(j + (ix << 6) << 1) - 130] + 
			    cikveb[j - 1] * cikveb[j - 1] / beam_ .sigman2[(j 
			    + (ix << 6) << 1) - 129]) / 2.;
		    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 129] * 
			    xrb[j - 1];
		    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 130] * 
			    zrb[j - 1];
 
		}
		wzsubv_(& tra1_ .napx, xrb, zrb, crxb, crzb);
		wzsubv_(& tra1_ .napx, xbb, zbb, cbxb, cbzb);
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) * cbzb[j 
			    - 1]) * d_sign(&c_b2366, &crkveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130]);
		    main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) * cbxb[j 
			    - 1]) * d_sign(&c_b2366, &cikveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129]);
 
		}
	    }
	    goto L620;
L720:
	    if (beam_ .ibtyp == 0) {
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) - 129] 
			    - beam_ .sigman2[(j + (ix << 6) << 1) - 130]) * 
			    2.;
		    rb[j - 1] = sqrt(r2b[j - 1]);
		    rkb[j - 1] = track_ .strack[i__ - 1] * kons_ .pisqrt / rb[
			    j - 1];
		    crkveb[j - 1] = main1_ .xv[(j << 1) - 2] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 130] + ell_ .ed[ix - 1];
		    cikveb[j - 1] = main1_ .xv[(j << 1) - 1] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 129] + ell_ .ek[ix - 1];
		    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    errf_(&zrb[j - 1], &xrb[j - 1], &crzb[j - 1], &crxb[j - 1]
			    );
		    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
			    beam_ .sigman2[(j + (ix << 6) << 1) - 130] + 
			    cikveb[j - 1] * cikveb[j - 1] / beam_ .sigman2[(j 
			    + (ix << 6) << 1) - 129]) / 2.;
		    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 129] * 
			    xrb[j - 1];
		    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 130] * 
			    zrb[j - 1];
		    errf_(&zbb[j - 1], &xbb[j - 1], &cbzb[j - 1], &cbxb[j - 1]
			    );
		    main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) * cbzb[j 
			    - 1]) * d_sign(&c_b2366, &crkveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130]);
		    main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) * cbxb[j 
			    - 1]) * d_sign(&c_b2366, &cikveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129]);
 
		}
	    } else if (beam_ .ibtyp == 1) {
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) - 129] 
			    - beam_ .sigman2[(j + (ix << 6) << 1) - 130]) * 
			    2.;
		    rb[j - 1] = sqrt(r2b[j - 1]);
		    rkb[j - 1] = track_ .strack[i__ - 1] * kons_ .pisqrt / rb[
			    j - 1];
		    crkveb[j - 1] = main1_ .xv[(j << 1) - 2] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 130] + ell_ .ed[ix - 1];
		    cikveb[j - 1] = main1_ .xv[(j << 1) - 1] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 129] + ell_ .ek[ix - 1];
		    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
			    beam_ .sigman2[(j + (ix << 6) << 1) - 130] + 
			    cikveb[j - 1] * cikveb[j - 1] / beam_ .sigman2[(j 
			    + (ix << 6) << 1) - 129]) / 2.;
		    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 129] * 
			    xrb[j - 1];
		    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 130] * 
			    zrb[j - 1];
 
		}
		wzsubv_(& tra1_ .napx, zrb, xrb, crzb, crxb);
		wzsubv_(& tra1_ .napx, zbb, xbb, cbzb, cbxb);
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) * cbzb[j 
			    - 1]) * d_sign(&c_b2366, &crkveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130]);
		    main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) * cbxb[j 
			    - 1]) * d_sign(&c_b2366, &cikveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129]);
 
		}
	    }
L620:
	    kpz = (i__3 = ell_ .kp[ix - 1], (( i__3 ) >= 0 ? ( i__3 ) : -( i__3 )) );
	    if (kpz == 0) {
		goto L630;
	    }
	    if (kpz == 1) {
		lostpar2_(&i__, &ix, nthinerr);
		if (*nthinerr != 0) {
		    return 0;
		}
		goto L630;
	    }
	    if (kpz == 3) {
		lostpar3_(&i__, &ix, nthinerr);
		if (*nthinerr != 0) {
		    return 0;
		}
	    }
L630:
	    ;
	}
	lostpart_(nthinerr);
	if (*nthinerr != 0) {
	    return 0;
	}
	if (tra1_ .ntwin != 2) {
	    dist1_();
	}
	if (n % tra1_ .nwr[3] == 0) {
	    write6_(&n);
	}
 
    }
    return 0;
}  

 
 
  int thin6d_(nthinerr)
integer *nthinerr;
{
     
    integer i__1, i__2, i__3, i__4;
    doublereal d__1, d__2, d__3;

     
    double sin(), sqrt();
    integer s_wsfe(), do_fio(), e_wsfe();
    double exp(), d_sign();

     
    extern   int lostpar2_(), lostpar3_(), writebin_(), 
	    lostpart_();
    static integer i__, j, k, n;
    static doublereal r0, rb[64];
    static integer ix;
    static doublereal r2b[64], crkveb[64], cikveb[64], rho2b[64], tkb[64], 
	    rkb[64], xrb[64], zrb[64], xbb[64], zbb[64], crxb[64], crzb[64], 
	    cbxb[64], cbzb[64], c5m4;
    extern   int ripple_();
    static doublereal crkve, cikve, xlvj, zlvj;
    static integer nmz;
    static doublereal yv1j, yv2j;
    extern   int errf_();
    static doublereal stracki;
    extern   int wzsubv_();
    static integer kpz;
    extern   int dist1_(), write6_();
    static doublereal crkveuk;

     
    static cilist io___4335 = { 0, 98, 0, "(1p,6(2x,e25.18))", 0 };


 


 


 
 

 
 

    c5m4 = 5e-4;
    *nthinerr = 0;
    i__1 = tra1_ .numl;
    for (n = 1; n <= i__1; ++n) {
	main4_ .numx = n - 1;
	if (ripp_ .irip == 1) {
	    ripple_(&n);
	}
	if (main4_ .numx % track_ .nwri == 0) {
	    writebin_(nthinerr);
	}
	if (*nthinerr != 0) {
	    return 0;
	}
	i__2 = str_ .iu;
	for (i__ = 1; i__ <= i__2; ++i__) {
	    ix = str_ .ic[i__ - 1] - 300;
	    switch ((int)(track_ .ktrack[i__ - 1])) {
		case 1:  goto L10;
		case 2:  goto L30;
		case 3:  goto L650;
		case 4:  goto L650;
		case 5:  goto L650;
		case 6:  goto L650;
		case 7:  goto L650;
		case 8:  goto L650;
		case 9:  goto L650;
		case 10:  goto L650;
		case 11:  goto L50;
		case 12:  goto L70;
		case 13:  goto L90;
		case 14:  goto L110;
		case 15:  goto L130;
		case 16:  goto L150;
		case 17:  goto L170;
		case 18:  goto L190;
		case 19:  goto L210;
		case 20:  goto L230;
		case 21:  goto L440;
		case 22:  goto L460;
		case 23:  goto L480;
		case 24:  goto L500;
		case 25:  goto L520;
		case 26:  goto L540;
		case 27:  goto L560;
		case 28:  goto L580;
		case 29:  goto L600;
		case 30:  goto L620;
		case 31:  goto L640;
		case 32:  goto L410;
		case 33:  goto L250;
		case 34:  goto L270;
		case 35:  goto L290;
		case 36:  goto L310;
		case 37:  goto L330;
		case 38:  goto L350;
		case 39:  goto L370;
		case 40:  goto L390;
		case 41:  goto L680;
		case 42:  goto L700;
		case 43:  goto L720;
	    }
	    goto L650;
L10:
	    stracki = track_ .strack[i__ - 1];
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xv[(j << 1) - 2] += stracki * main1_ .yv[(j << 1) - 2]
			;
		main1_ .xv[(j << 1) - 1] += stracki * main1_ .yv[(j << 1) - 1]
			;
		main1_ .sigmv[j - 1] += stracki * (1e3 - main1_ .rvv[j - 1] * 
			((main1_ .yv[(j << 1) - 2] * main1_ .yv[(j << 1) - 2] 
			+ main1_ .yv[(j << 1) - 1] * main1_ .yv[(j << 1) - 1])
			 * c5m4 + 1e3));
 
	    }
	    goto L650;
L30:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .ejf0v[j - 1] = main1_ .ejfv[j - 1];
		if ((( syn_ .dppoff ) >= 0 ? ( syn_ .dppoff ) : -( syn_ .dppoff ))  > 1e-17) {
		    main1_ .sigmv[j - 1] -= syn_ .sigmoff[i__ - 1];
		}
		if (ell_ .kz[ix - 1] == 12) {
		    main1_ .ejv[j - 1] += ell_ .ed[ix - 1] * sin(syn_ .hsyc[
			    ix - 1] * main1_ .sigmv[j - 1] + syn_ .phasc[ix - 
			    1]);
		} else {
		    main1_ .ejv[j - 1] += syn_ .hsy[0] * sin(syn_ .hsy[2] * 
			    main1_ .sigmv[j - 1]);
		}
		main1_ .ejfv[j - 1] = sqrt(main1_ .ejv[j - 1] * main1_ .ejv[j 
			- 1] - syn_ .pma * syn_ .pma);
		main1_ .rvv[j - 1] = main1_ .ejv[j - 1] / syn_ .e0 * 
			main4_ .e0f / main1_ .ejfv[j - 1];
		main1_ .dpsv[j - 1] = (main1_ .ejfv[j - 1] - main4_ .e0f) / 
			main4_ .e0f;
		main2_ .oidpsv[j - 1] = 1. / (main1_ .dpsv[j - 1] + 1.);
		track_ .dpsv1[j - 1] = main1_ .dpsv[j - 1] * 1e3 * 
			main2_ .oidpsv[j - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .ejf0v[j - 1] / 
			main1_ .ejfv[j - 1] * main1_ .yv[(j << 1) - 2];
 
		main1_ .yv[(j << 1) - 1] = main1_ .ejf0v[j - 1] / 
			main1_ .ejfv[j - 1] * main1_ .yv[(j << 1) - 1];
	    }
	    if (n == 1) {
		s_wsfe(&io___4335);
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    do_fio(&c__1, (char *)& main1_ .xv[(j << 1) - 2], (ftnlen)
			    sizeof(doublereal));
		    d__1 = main1_ .yv[(j << 1) - 2] * (main1_ .dpsv[j - 1] + 
			    1.);
		    do_fio(&c__1, (char *)&d__1, (ftnlen)sizeof(doublereal));
		    do_fio(&c__1, (char *)& main1_ .xv[(j << 1) - 1], (ftnlen)
			    sizeof(doublereal));
		    d__2 = main1_ .yv[(j << 1) - 1] * (main1_ .dpsv[j - 1] + 
			    1.);
		    do_fio(&c__1, (char *)&d__2, (ftnlen)sizeof(doublereal));
		    do_fio(&c__1, (char *)& main1_ .sigmv[j - 1], (ftnlen)
			    sizeof(doublereal));
		    d__3 = main1_ .dpsv[j - 1] * 1e3;
		    do_fio(&c__1, (char *)&d__3, (ftnlen)sizeof(doublereal));
		}
		e_wsfe();
	    }
	    goto L640;
 
L50:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .yv[(j << 1) - 2] += track_ .strackc[i__ - 1] * 
			main2_ .oidpsv[j - 1];
		main1_ .yv[(j << 1) - 1] += track_ .stracks[i__ - 1] * 
			main2_ .oidpsv[j - 1];
 
	    }
	    goto L640;
 
L70:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L640;
 
L90:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L640;
 
L110:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L640;
 
L130:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L640;
 
L150:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L640;
 
L170:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L640;
 
L190:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L640;
 
L210:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L640;
 
L230:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L640;
L250:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - (
			track_ .strack[i__ - 1] * xlvj * main2_ .oidpsv[j - 1]
			 + track_ .dpsv1[j - 1]) * dkic_ .dki[ix - 1] * 
			rand1_ .tiltc[i__ - 1] + dkic_ .dki[ix - 1] * 1e3 * 
			main2_ .oidpsv[j - 1] * (1. - rand1_ .tiltc[i__ - 1]);
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - (
			track_ .strack[i__ - 1] * xlvj * main2_ .oidpsv[j - 1]
			 + track_ .dpsv1[j - 1]) * dkic_ .dki[ix - 1] * 
			rand1_ .tilts[i__ - 1] + dkic_ .dki[ix - 1] * 1e3 * 
			main2_ .oidpsv[j - 1] * rand1_ .tilts[i__ - 1];
		main1_ .sigmv[j - 1] += main1_ .rvv[j - 1] * dkic_ .dki[ix - 
			1] * xlvj;
 
	    }
	    goto L640;
L270:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - (
			track_ .strack[i__ - 1] * xlvj * main2_ .oidpsv[j - 1]
			 + track_ .dpsv1[j - 1]) * dkic_ .dki[ix - 1] * 
			rand1_ .tiltc[i__ - 1] + dkic_ .dki[ix - 1] * 1e3 * 
			main2_ .oidpsv[j - 1] * (1. - rand1_ .tiltc[i__ - 1]);
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - (
			track_ .strack[i__ - 1] * xlvj * main2_ .oidpsv[j - 1]
			 + track_ .dpsv1[j - 1]) * dkic_ .dki[ix - 1] * 
			rand1_ .tilts[i__ - 1] + dkic_ .dki[ix - 1] * 1e3 * 
			main2_ .oidpsv[j - 1] * rand1_ .tilts[i__ - 1];
		main1_ .sigmv[j - 1] += main1_ .rvv[j - 1] * dkic_ .dki[ix - 
			1] * xlvj;
 
	    }
	    goto L410;
L290:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - 
			track_ .strackc[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix - 1] * 1e3 * main2_ .oidpsv[j - 1] * (
			1. - rand1_ .tiltc[i__ - 1]);
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - 
			track_ .stracks[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix - 1] * 1e3 * main2_ .oidpsv[j - 1] * 
			rand1_ .tilts[i__ - 1];
		main1_ .sigmv[j - 1] += main1_ .rvv[j - 1] * dkic_ .dki[ix - 
			1] * xlvj;
 
	    }
	    goto L640;
L310:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - 
			track_ .strackc[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix - 1] * 1e3 * main2_ .oidpsv[j - 1] * (
			1. - rand1_ .tiltc[i__ - 1]);
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - 
			track_ .stracks[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix - 1] * 1e3 * main2_ .oidpsv[j - 1] * 
			rand1_ .tilts[i__ - 1];
		main1_ .sigmv[j - 1] += main1_ .rvv[j - 1] * dkic_ .dki[ix - 
			1] * xlvj;
 
	    }
	    goto L410;
L330:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] + (
			track_ .strack[i__ - 1] * zlvj * main2_ .oidpsv[j - 1]
			 - track_ .dpsv1[j - 1]) * dkic_ .dki[ix + 699] * 
			rand1_ .tilts[i__ - 1] + dkic_ .dki[ix + 699] * 1e3 * 
			main2_ .oidpsv[j - 1] * rand1_ .tilts[i__ - 1];
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - (
			track_ .strack[i__ - 1] * zlvj * main2_ .oidpsv[j - 1]
			 - track_ .dpsv1[j - 1]) * dkic_ .dki[ix + 699] * 
			rand1_ .tiltc[i__ - 1] - dkic_ .dki[ix + 699] * 1e3 * 
			main2_ .oidpsv[j - 1] * (1. - rand1_ .tiltc[i__ - 1]);
		main1_ .sigmv[j - 1] -= main1_ .rvv[j - 1] * dkic_ .dki[ix + 
			699] * zlvj;
 
	    }
	    goto L640;
L350:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] + (
			track_ .strack[i__ - 1] * zlvj * main2_ .oidpsv[j - 1]
			 - track_ .dpsv1[j - 1]) * dkic_ .dki[ix + 699] * 
			rand1_ .tilts[i__ - 1] + dkic_ .dki[ix + 699] * 1e3 * 
			main2_ .oidpsv[j - 1] * rand1_ .tilts[i__ - 1];
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - (
			track_ .strack[i__ - 1] * zlvj * main2_ .oidpsv[j - 1]
			 - track_ .dpsv1[j - 1]) * dkic_ .dki[ix + 699] * 
			rand1_ .tiltc[i__ - 1] - dkic_ .dki[ix + 699] * 1e3 * 
			main2_ .oidpsv[j - 1] * (1. - rand1_ .tiltc[i__ - 1]);
		main1_ .sigmv[j - 1] -= main1_ .rvv[j - 1] * dkic_ .dki[ix + 
			699] * zlvj;
 
	    }
	    goto L410;
L370:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - 
			track_ .stracks[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix + 699] * 1e3 * main2_ .oidpsv[j - 1] * 
			rand1_ .tilts[i__ - 1];
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] + 
			track_ .strackc[i__ - 1] * track_ .dpsv1[j - 1] - 
			dkic_ .dki[ix + 699] * 1e3 * main2_ .oidpsv[j - 1] * (
			1. - rand1_ .tiltc[i__ - 1]);
		main1_ .sigmv[j - 1] -= main1_ .rvv[j - 1] * dkic_ .dki[ix + 
			699] * zlvj;
 
	    }
	    goto L640;
L390:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - 
			track_ .stracks[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix + 699] * 1e3 * main2_ .oidpsv[j - 1] * 
			rand1_ .tilts[i__ - 1];
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] + 
			track_ .strackc[i__ - 1] * track_ .dpsv1[j - 1] - 
			dkic_ .dki[ix + 699] * 1e3 * main2_ .oidpsv[j - 1] * (
			1. - rand1_ .tiltc[i__ - 1]);
		main1_ .sigmv[j - 1] -= main1_ .rvv[j - 1] * dkic_ .dki[ix + 
			699] * zlvj;
 
	    }
L410:
	    r0 = ell_ .ek[ix - 1];
	    nmz = mult1_ .nmu[ix - 1];
	    if (nmz >= 2) {
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) 
			    * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 
			    1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 
			    1];
		    zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1])
			     * rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) 
			    - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ 
			    - 1];
		    yv1j = main1_ .bbiv[(i__ + 1) * 11 - 22] + main1_ .bbiv[(
			    i__ + 1) * 11 - 21] * xlvj + main1_ .aaiv[(i__ + 
			    1) * 11 - 21] * zlvj;
		    yv2j = main1_ .aaiv[(i__ + 1) * 11 - 22] - main1_ .bbiv[(
			    i__ + 1) * 11 - 21] * zlvj + main1_ .aaiv[(i__ + 
			    1) * 11 - 21] * xlvj;
		    crkve = xlvj;
		    cikve = zlvj;
		    i__4 = nmz;
		    for (k = 3; k <= i__4; ++k) {
			crkveuk = crkve * xlvj - cikve * zlvj;
			cikve = crkve * zlvj + cikve * xlvj;
			crkve = crkveuk;
			yv1j = yv1j + main1_ .bbiv[k + (i__ + 1) * 11 - 23] * 
				crkve + main1_ .aaiv[k + (i__ + 1) * 11 - 23] 
				* cikve;
			yv2j = yv2j - main1_ .bbiv[k + (i__ + 1) * 11 - 23] * 
				cikve + main1_ .aaiv[k + (i__ + 1) * 11 - 23] 
				* crkve;
 
		    }
		    main1_ .yv[(j << 1) - 2] += (rand1_ .tiltc[i__ - 1] * 
			    yv1j - rand1_ .tilts[i__ - 1] * yv2j) * 
			    main2_ .oidpsv[j - 1];
		    main1_ .yv[(j << 1) - 1] += (rand1_ .tiltc[i__ - 1] * 
			    yv2j + rand1_ .tilts[i__ - 1] * yv1j) * 
			    main2_ .oidpsv[j - 1];
 
		}
	    } else {
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    main1_ .yv[(j << 1) - 2] += (rand1_ .tiltc[i__ - 1] * 
			    main1_ .bbiv[(i__ + 1) * 11 - 22] - rand1_ .tilts[
			    i__ - 1] * main1_ .aaiv[(i__ + 1) * 11 - 22]) * 
			    main2_ .oidpsv[j - 1];
		    main1_ .yv[(j << 1) - 1] += (rand1_ .tiltc[i__ - 1] * 
			    main1_ .aaiv[(i__ + 1) * 11 - 22] + rand1_ .tilts[
			    i__ - 1] * main1_ .bbiv[(i__ + 1) * 11 - 22]) * 
			    main2_ .oidpsv[j - 1];
 
		}
	    }
	    goto L640;
 
 
L440:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .yv[(j << 1) - 2] -= track_ .stracks[i__ - 1] * 
			main2_ .oidpsv[j - 1];
		main1_ .yv[(j << 1) - 1] += track_ .strackc[i__ - 1] * 
			main2_ .oidpsv[j - 1];
 
	    }
	    goto L640;
 
L460:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L640;
 
L480:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L640;
 
L500:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L640;
 
L520:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L640;
 
L540:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L640;
 
L560:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L640;
 
L580:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L640;
 
L600:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L640;
 
L620:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L640;
L680:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		crkveb[j - 1] = main1_ .xv[(j << 1) - 2] - beam_ .clobeam[(j 
			+ (ix << 6) << 1) - 130] + ell_ .ed[ix - 1];
		cikveb[j - 1] = main1_ .xv[(j << 1) - 1] - beam_ .clobeam[(j 
			+ (ix << 6) << 1) - 129] + ell_ .ek[ix - 1];
		rho2b[j - 1] = crkveb[j - 1] * crkveb[j - 1] + cikveb[j - 1] *
			 cikveb[j - 1];
		if (rho2b[j - 1] <= 1e-17) {
		    goto L690;
		}
		tkb[j - 1] = rho2b[j - 1] / (beam_ .sigman2[(j + (ix << 6) << 
			1) - 130] * 2.);
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strack[i__ - 1] * crkveb[j - 1] / rho2b[j - 1]
			 * (1. - exp(-tkb[j - 1])) - beam_ .beamoff[(j + (ix 
			<< 6) << 1) - 130]);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strack[i__ - 1] * cikveb[j - 1] / rho2b[j - 1]
			 * (1. - exp(-tkb[j - 1])) - beam_ .beamoff[(j + (ix 
			<< 6) << 1) - 129]);
L690:
		;
	    }
	    goto L640;
L700:
	    if (beam_ .ibtyp == 0) {
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) - 130] 
			    - beam_ .sigman2[(j + (ix << 6) << 1) - 129]) * 
			    2.;
		    rb[j - 1] = sqrt(r2b[j - 1]);
		    rkb[j - 1] = track_ .strack[i__ - 1] * kons_ .pisqrt / rb[
			    j - 1];
		    crkveb[j - 1] = main1_ .xv[(j << 1) - 2] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 130] + ell_ .ed[ix - 1];
		    cikveb[j - 1] = main1_ .xv[(j << 1) - 1] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 129] + ell_ .ek[ix - 1];
		    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    errf_(&xrb[j - 1], &zrb[j - 1], &crxb[j - 1], &crzb[j - 1]
			    );
		    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
			    beam_ .sigman2[(j + (ix << 6) << 1) - 130] + 
			    cikveb[j - 1] * cikveb[j - 1] / beam_ .sigman2[(j 
			    + (ix << 6) << 1) - 129]) / 2.;
		    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 129] * 
			    xrb[j - 1];
		    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 130] * 
			    zrb[j - 1];
		    errf_(&xbb[j - 1], &zbb[j - 1], &cbxb[j - 1], &cbzb[j - 1]
			    );
		    main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) * cbzb[j 
			    - 1]) * d_sign(&c_b2366, &crkveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130]);
		    main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) * cbxb[j 
			    - 1]) * d_sign(&c_b2366, &cikveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129]);
 
		}
	    } else if (beam_ .ibtyp == 1) {
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) - 130] 
			    - beam_ .sigman2[(j + (ix << 6) << 1) - 129]) * 
			    2.;
		    rb[j - 1] = sqrt(r2b[j - 1]);
		    rkb[j - 1] = track_ .strack[i__ - 1] * kons_ .pisqrt / rb[
			    j - 1];
		    crkveb[j - 1] = main1_ .xv[(j << 1) - 2] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 130] + ell_ .ed[ix - 1];
		    cikveb[j - 1] = main1_ .xv[(j << 1) - 1] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 129] + ell_ .ek[ix - 1];
		    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
			    beam_ .sigman2[(j + (ix << 6) << 1) - 130] + 
			    cikveb[j - 1] * cikveb[j - 1] / beam_ .sigman2[(j 
			    + (ix << 6) << 1) - 129]) / 2.;
		    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 129] * 
			    xrb[j - 1];
		    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 130] * 
			    zrb[j - 1];
 
		}
		wzsubv_(& tra1_ .napx, xrb, zrb, crxb, crzb);
		wzsubv_(& tra1_ .napx, xbb, zbb, cbxb, cbzb);
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) * cbzb[j 
			    - 1]) * d_sign(&c_b2366, &crkveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130]);
		    main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) * cbxb[j 
			    - 1]) * d_sign(&c_b2366, &cikveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129]);
 
		}
	    }
	    goto L640;
L720:
	    if (beam_ .ibtyp == 0) {
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) - 129] 
			    - beam_ .sigman2[(j + (ix << 6) << 1) - 130]) * 
			    2.;
		    rb[j - 1] = sqrt(r2b[j - 1]);
		    rkb[j - 1] = track_ .strack[i__ - 1] * kons_ .pisqrt / rb[
			    j - 1];
		    crkveb[j - 1] = main1_ .xv[(j << 1) - 2] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 130] + ell_ .ed[ix - 1];
		    cikveb[j - 1] = main1_ .xv[(j << 1) - 1] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 129] + ell_ .ek[ix - 1];
		    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    errf_(&zrb[j - 1], &xrb[j - 1], &crzb[j - 1], &crxb[j - 1]
			    );
		    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
			    beam_ .sigman2[(j + (ix << 6) << 1) - 130] + 
			    cikveb[j - 1] * cikveb[j - 1] / beam_ .sigman2[(j 
			    + (ix << 6) << 1) - 129]) / 2.;
		    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 129] * 
			    xrb[j - 1];
		    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 130] * 
			    zrb[j - 1];
		    errf_(&zbb[j - 1], &xbb[j - 1], &cbzb[j - 1], &cbxb[j - 1]
			    );
		    main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) * cbzb[j 
			    - 1]) * d_sign(&c_b2366, &crkveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130]);
		    main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) * cbxb[j 
			    - 1]) * d_sign(&c_b2366, &cikveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129]);
 
		}
	    } else if (beam_ .ibtyp == 1) {
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) - 129] 
			    - beam_ .sigman2[(j + (ix << 6) << 1) - 130]) * 
			    2.;
		    rb[j - 1] = sqrt(r2b[j - 1]);
		    rkb[j - 1] = track_ .strack[i__ - 1] * kons_ .pisqrt / rb[
			    j - 1];
		    crkveb[j - 1] = main1_ .xv[(j << 1) - 2] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 130] + ell_ .ed[ix - 1];
		    cikveb[j - 1] = main1_ .xv[(j << 1) - 1] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 129] + ell_ .ek[ix - 1];
		    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
			    beam_ .sigman2[(j + (ix << 6) << 1) - 130] + 
			    cikveb[j - 1] * cikveb[j - 1] / beam_ .sigman2[(j 
			    + (ix << 6) << 1) - 129]) / 2.;
		    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 129] * 
			    xrb[j - 1];
		    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 130] * 
			    zrb[j - 1];
 
		}
		wzsubv_(& tra1_ .napx, zrb, xrb, crzb, crxb);
		wzsubv_(& tra1_ .napx, zbb, xbb, cbzb, cbxb);
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) * cbzb[j 
			    - 1]) * d_sign(&c_b2366, &crkveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130]);
		    main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) * cbxb[j 
			    - 1]) * d_sign(&c_b2366, &cikveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129]);
 
		}
	    }
L640:
	    kpz = (i__3 = ell_ .kp[ix - 1], (( i__3 ) >= 0 ? ( i__3 ) : -( i__3 )) );
	    if (kpz == 0) {
		goto L650;
	    }
	    if (kpz == 1) {
		lostpar2_(&i__, &ix, nthinerr);
		if (*nthinerr != 0) {
		    return 0;
		}
		goto L650;
	    }
	    if (kpz == 3) {
		lostpar3_(&i__, &ix, nthinerr);
		if (*nthinerr != 0) {
		    return 0;
		}
	    }
L650:
	    ;
	}
	lostpart_(nthinerr);
	if (*nthinerr != 0) {
	    return 0;
	}
	if (tra1_ .ntwin != 2) {
	    dist1_();
	}
	if (n % tra1_ .nwr[3] == 0) {
	    write6_(&n);
	}
 
    }
    return 0;
}  

 
 
  int thin6dua_(nthinerr)
integer *nthinerr;
{
     
    integer i__1, i__2, i__3, i__4;
    doublereal d__1, d__2, d__3;

     
    double sin(), sqrt();
    integer s_wsfe(), do_fio(), e_wsfe();
    double exp(), d_sign();

     
    extern   int lostpar2_(), lostpar3_(), writebin_(), 
	    lostpart_();
    static integer i__, j, k, n;
    static doublereal r0, rb[64];
    static integer ix;
    static doublereal e0o, r2b[64], crkveb[64], cikveb[64], rho2b[64], tkb[64]
	    , rkb[64], xrb[64], zrb[64], xbb[64], zbb[64], crxb[64], crzb[64],
	     cbxb[64], cbzb[64], c5m4;
    extern   int ripple_();
    static doublereal e0fo;
    extern   int adia_();
    static doublereal crkve, cikve, xlvj, zlvj;
    static integer nmz;
    static doublereal yv1j, yv2j;
    extern   int errf_();
    static doublereal stracki;
    extern   int wzsubv_();
    static integer kpz;
    extern   int dist1_(), write6_();
    static doublereal crkveuk;

     
    static cilist io___4370 = { 0, 98, 0, "(1p,6(2x,e25.18))", 0 };


 


 


 
 

 
 

    c5m4 = 5e-4;
    *nthinerr = 0;
    i__1 = tra1_ .numl;
    for (n = 1; n <= i__1; ++n) {
	main4_ .numx = n - 1;
	if (ripp_ .irip == 1) {
	    ripple_(&n);
	}
	if (n <= tra1_ .nde[0]) {
	    track_ .nwri = tra1_ .nwr[0];
	}
	if (n > tra1_ .nde[0] && n <= tra1_ .nde[1]) {
	    track_ .nwri = tra1_ .nwr[1];
	}
	if (n > tra1_ .nde[1]) {
	    track_ .nwri = tra1_ .nwr[2];
	}
	if (track_ .nwri == 0) {
	    track_ .nwri = tra1_ .numl + tra1_ .numlr + 1;
	}
	if (main4_ .numx % track_ .nwri == 0) {
	    writebin_(nthinerr);
	}
	if (*nthinerr != 0) {
	    return 0;
	}
	i__2 = str_ .iu;
	for (i__ = 1; i__ <= i__2; ++i__) {
	    ix = str_ .ic[i__ - 1] - 300;
	    switch ((int)(track_ .ktrack[i__ - 1])) {
		case 1:  goto L10;
		case 2:  goto L30;
		case 3:  goto L650;
		case 4:  goto L650;
		case 5:  goto L650;
		case 6:  goto L650;
		case 7:  goto L650;
		case 8:  goto L650;
		case 9:  goto L650;
		case 10:  goto L650;
		case 11:  goto L50;
		case 12:  goto L70;
		case 13:  goto L90;
		case 14:  goto L110;
		case 15:  goto L130;
		case 16:  goto L150;
		case 17:  goto L170;
		case 18:  goto L190;
		case 19:  goto L210;
		case 20:  goto L230;
		case 21:  goto L440;
		case 22:  goto L460;
		case 23:  goto L480;
		case 24:  goto L500;
		case 25:  goto L520;
		case 26:  goto L540;
		case 27:  goto L560;
		case 28:  goto L580;
		case 29:  goto L600;
		case 30:  goto L620;
		case 31:  goto L640;
		case 32:  goto L410;
		case 33:  goto L250;
		case 34:  goto L270;
		case 35:  goto L290;
		case 36:  goto L310;
		case 37:  goto L330;
		case 38:  goto L350;
		case 39:  goto L370;
		case 40:  goto L390;
		case 41:  goto L680;
		case 42:  goto L700;
		case 43:  goto L720;
	    }
	    goto L650;
L10:
	    stracki = track_ .strack[i__ - 1];
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xv[(j << 1) - 2] += stracki * main1_ .yv[(j << 1) - 2]
			;
		main1_ .xv[(j << 1) - 1] += stracki * main1_ .yv[(j << 1) - 1]
			;
		main1_ .sigmv[j - 1] += stracki * (1e3 - main1_ .rvv[j - 1] * 
			((main1_ .yv[(j << 1) - 2] * main1_ .yv[(j << 1) - 2] 
			+ main1_ .yv[(j << 1) - 1] * main1_ .yv[(j << 1) - 1])
			 * c5m4 + 1e3));
 
	    }
	    goto L650;
L30:
	    e0o = syn_ .e0;
	    e0fo = main4_ .e0f;
	    adia_(&n, & main4_ .e0f);
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .ejf0v[j - 1] = main1_ .ejfv[j - 1];
		if ((( syn_ .dppoff ) >= 0 ? ( syn_ .dppoff ) : -( syn_ .dppoff ))  > 1e-17) {
		    main1_ .sigmv[j - 1] -= syn_ .sigmoff[i__ - 1];
		}
		if (main1_ .sigmv[j - 1] < 0.) {
		    main1_ .sigmv[j - 1] = main4_ .e0f * e0o / (e0fo * 
			    syn_ .e0) * main1_ .sigmv[j - 1];
		}
		if (ell_ .kz[ix - 1] == 12) {
		    main1_ .ejv[j - 1] += ell_ .ed[ix - 1] * sin(syn_ .hsyc[
			    ix - 1] * main1_ .sigmv[j - 1] + syn_ .phas + 
			    syn_ .phasc[ix - 1]);
		} else {
		    main1_ .ejv[j - 1] += syn_ .hsy[0] * sin(syn_ .hsy[2] * 
			    main1_ .sigmv[j - 1] + syn_ .phas);
		}
		main1_ .ejfv[j - 1] = sqrt(main1_ .ejv[j - 1] * main1_ .ejv[j 
			- 1] - syn_ .pma * syn_ .pma);
		main1_ .rvv[j - 1] = main1_ .ejv[j - 1] / syn_ .e0 * 
			main4_ .e0f / main1_ .ejfv[j - 1];
		main1_ .dpsv[j - 1] = (main1_ .ejfv[j - 1] - main4_ .e0f) / 
			main4_ .e0f;
		main2_ .oidpsv[j - 1] = 1. / (main1_ .dpsv[j - 1] + 1.);
		track_ .dpsv1[j - 1] = main1_ .dpsv[j - 1] * 1e3 * 
			main2_ .oidpsv[j - 1];
		if (main1_ .sigmv[j - 1] > 0.) {
		    main1_ .sigmv[j - 1] = main4_ .e0f * e0o / (e0fo * 
			    syn_ .e0) * main1_ .sigmv[j - 1];
		}
		main1_ .yv[(j << 1) - 2] = main1_ .ejf0v[j - 1] / 
			main1_ .ejfv[j - 1] * main1_ .yv[(j << 1) - 2];
 
		main1_ .yv[(j << 1) - 1] = main1_ .ejf0v[j - 1] / 
			main1_ .ejfv[j - 1] * main1_ .yv[(j << 1) - 1];
	    }
	    if (n == 1) {
		s_wsfe(&io___4370);
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    do_fio(&c__1, (char *)& main1_ .xv[(j << 1) - 2], (ftnlen)
			    sizeof(doublereal));
		    d__1 = main1_ .yv[(j << 1) - 2] * (main1_ .dpsv[j - 1] + 
			    1.);
		    do_fio(&c__1, (char *)&d__1, (ftnlen)sizeof(doublereal));
		    do_fio(&c__1, (char *)& main1_ .xv[(j << 1) - 1], (ftnlen)
			    sizeof(doublereal));
		    d__2 = main1_ .yv[(j << 1) - 1] * (main1_ .dpsv[j - 1] + 
			    1.);
		    do_fio(&c__1, (char *)&d__2, (ftnlen)sizeof(doublereal));
		    do_fio(&c__1, (char *)& main1_ .sigmv[j - 1], (ftnlen)
			    sizeof(doublereal));
		    d__3 = main1_ .dpsv[j - 1] * 1e3;
		    do_fio(&c__1, (char *)&d__3, (ftnlen)sizeof(doublereal));
		}
		e_wsfe();
	    }
	    goto L640;
 
L50:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .yv[(j << 1) - 2] += track_ .strackc[i__ - 1] * 
			main2_ .oidpsv[j - 1];
		main1_ .yv[(j << 1) - 1] += track_ .stracks[i__ - 1] * 
			main2_ .oidpsv[j - 1];
 
	    }
	    goto L640;
 
L70:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L640;
 
L90:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L640;
 
L110:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L640;
 
L130:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L640;
 
L150:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L640;
 
L170:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L640;
 
L190:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L640;
 
L210:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L640;
 
L230:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			- track_ .strackc[i__ - 1] * cikve + track_ .stracks[
			i__ - 1] * crkve);
 
	    }
	    goto L640;
L250:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - (
			track_ .strack[i__ - 1] * xlvj * main2_ .oidpsv[j - 1]
			 + track_ .dpsv1[j - 1]) * dkic_ .dki[ix - 1] * 
			rand1_ .tiltc[i__ - 1] + dkic_ .dki[ix - 1] * 1e3 * 
			main2_ .oidpsv[j - 1] * (1. - rand1_ .tiltc[i__ - 1]);
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - (
			track_ .strack[i__ - 1] * xlvj * main2_ .oidpsv[j - 1]
			 + track_ .dpsv1[j - 1]) * dkic_ .dki[ix - 1] * 
			rand1_ .tilts[i__ - 1] + dkic_ .dki[ix - 1] * 1e3 * 
			main2_ .oidpsv[j - 1] * rand1_ .tilts[i__ - 1];
		main1_ .sigmv[j - 1] += main1_ .rvv[j - 1] * dkic_ .dki[ix - 
			1] * xlvj;
 
	    }
	    goto L640;
L270:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - (
			track_ .strack[i__ - 1] * xlvj * main2_ .oidpsv[j - 1]
			 + track_ .dpsv1[j - 1]) * dkic_ .dki[ix - 1] * 
			rand1_ .tiltc[i__ - 1] + dkic_ .dki[ix - 1] * 1e3 * 
			main2_ .oidpsv[j - 1] * (1. - rand1_ .tiltc[i__ - 1]);
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - (
			track_ .strack[i__ - 1] * xlvj * main2_ .oidpsv[j - 1]
			 + track_ .dpsv1[j - 1]) * dkic_ .dki[ix - 1] * 
			rand1_ .tilts[i__ - 1] + dkic_ .dki[ix - 1] * 1e3 * 
			main2_ .oidpsv[j - 1] * rand1_ .tilts[i__ - 1];
		main1_ .sigmv[j - 1] += main1_ .rvv[j - 1] * dkic_ .dki[ix - 
			1] * xlvj;
 
	    }
	    goto L410;
L290:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - 
			track_ .strackc[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix - 1] * 1e3 * main2_ .oidpsv[j - 1] * (
			1. - rand1_ .tiltc[i__ - 1]);
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - 
			track_ .stracks[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix - 1] * 1e3 * main2_ .oidpsv[j - 1] * 
			rand1_ .tilts[i__ - 1];
		main1_ .sigmv[j - 1] += main1_ .rvv[j - 1] * dkic_ .dki[ix - 
			1] * xlvj;
 
	    }
	    goto L640;
L310:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - 
			track_ .strackc[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix - 1] * 1e3 * main2_ .oidpsv[j - 1] * (
			1. - rand1_ .tiltc[i__ - 1]);
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - 
			track_ .stracks[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix - 1] * 1e3 * main2_ .oidpsv[j - 1] * 
			rand1_ .tilts[i__ - 1];
		main1_ .sigmv[j - 1] += main1_ .rvv[j - 1] * dkic_ .dki[ix - 
			1] * xlvj;
 
	    }
	    goto L410;
L330:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] + (
			track_ .strack[i__ - 1] * zlvj * main2_ .oidpsv[j - 1]
			 - track_ .dpsv1[j - 1]) * dkic_ .dki[ix + 699] * 
			rand1_ .tilts[i__ - 1] + dkic_ .dki[ix + 699] * 1e3 * 
			main2_ .oidpsv[j - 1] * rand1_ .tilts[i__ - 1];
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - (
			track_ .strack[i__ - 1] * zlvj * main2_ .oidpsv[j - 1]
			 - track_ .dpsv1[j - 1]) * dkic_ .dki[ix + 699] * 
			rand1_ .tiltc[i__ - 1] - dkic_ .dki[ix + 699] * 1e3 * 
			main2_ .oidpsv[j - 1] * (1. - rand1_ .tiltc[i__ - 1]);
		main1_ .sigmv[j - 1] -= main1_ .rvv[j - 1] * dkic_ .dki[ix + 
			699] * zlvj;
 
	    }
	    goto L640;
L350:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] + (
			track_ .strack[i__ - 1] * zlvj * main2_ .oidpsv[j - 1]
			 - track_ .dpsv1[j - 1]) * dkic_ .dki[ix + 699] * 
			rand1_ .tilts[i__ - 1] + dkic_ .dki[ix + 699] * 1e3 * 
			main2_ .oidpsv[j - 1] * rand1_ .tilts[i__ - 1];
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] - (
			track_ .strack[i__ - 1] * zlvj * main2_ .oidpsv[j - 1]
			 - track_ .dpsv1[j - 1]) * dkic_ .dki[ix + 699] * 
			rand1_ .tiltc[i__ - 1] - dkic_ .dki[ix + 699] * 1e3 * 
			main2_ .oidpsv[j - 1] * (1. - rand1_ .tiltc[i__ - 1]);
		main1_ .sigmv[j - 1] -= main1_ .rvv[j - 1] * dkic_ .dki[ix + 
			699] * zlvj;
 
	    }
	    goto L410;
L370:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - 
			track_ .stracks[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix + 699] * 1e3 * main2_ .oidpsv[j - 1] * 
			rand1_ .tilts[i__ - 1];
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] + 
			track_ .strackc[i__ - 1] * track_ .dpsv1[j - 1] - 
			dkic_ .dki[ix + 699] * 1e3 * main2_ .oidpsv[j - 1] * (
			1. - rand1_ .tiltc[i__ - 1]);
		main1_ .sigmv[j - 1] -= main1_ .rvv[j - 1] * dkic_ .dki[ix + 
			699] * zlvj;
 
	    }
	    goto L640;
L390:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 1];
		zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) * 
			rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) - 1] - 
			main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ - 1];
		main1_ .yv[(j << 1) - 2] = main1_ .yv[(j << 1) - 2] - 
			track_ .stracks[i__ - 1] * track_ .dpsv1[j - 1] + 
			dkic_ .dki[ix + 699] * 1e3 * main2_ .oidpsv[j - 1] * 
			rand1_ .tilts[i__ - 1];
		main1_ .yv[(j << 1) - 1] = main1_ .yv[(j << 1) - 1] + 
			track_ .strackc[i__ - 1] * track_ .dpsv1[j - 1] - 
			dkic_ .dki[ix + 699] * 1e3 * main2_ .oidpsv[j - 1] * (
			1. - rand1_ .tiltc[i__ - 1]);
		main1_ .sigmv[j - 1] -= main1_ .rvv[j - 1] * dkic_ .dki[ix + 
			699] * zlvj;
 
	    }
L410:
	    r0 = ell_ .ek[ix - 1];
	    nmz = mult1_ .nmu[ix - 1];
	    if (nmz >= 2) {
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    xlvj = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1]) 
			    * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j << 1) - 
			    1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ - 
			    1];
		    zlvj = -(main1_ .xv[(j << 1) - 2] - main1_ .xsiv[i__ - 1])
			     * rand1_ .tilts[i__ - 1] + (main1_ .xv[(j << 1) 
			    - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tiltc[i__ 
			    - 1];
		    yv1j = main1_ .bbiv[(i__ + 1) * 11 - 22] + main1_ .bbiv[(
			    i__ + 1) * 11 - 21] * xlvj + main1_ .aaiv[(i__ + 
			    1) * 11 - 21] * zlvj;
		    yv2j = main1_ .aaiv[(i__ + 1) * 11 - 22] - main1_ .bbiv[(
			    i__ + 1) * 11 - 21] * zlvj + main1_ .aaiv[(i__ + 
			    1) * 11 - 21] * xlvj;
		    crkve = xlvj;
		    cikve = zlvj;
		    i__4 = nmz;
		    for (k = 3; k <= i__4; ++k) {
			crkveuk = crkve * xlvj - cikve * zlvj;
			cikve = crkve * zlvj + cikve * xlvj;
			crkve = crkveuk;
			yv1j = yv1j + main1_ .bbiv[k + (i__ + 1) * 11 - 23] * 
				crkve + main1_ .aaiv[k + (i__ + 1) * 11 - 23] 
				* cikve;
			yv2j = yv2j - main1_ .bbiv[k + (i__ + 1) * 11 - 23] * 
				cikve + main1_ .aaiv[k + (i__ + 1) * 11 - 23] 
				* crkve;
 
		    }
		    main1_ .yv[(j << 1) - 2] += (rand1_ .tiltc[i__ - 1] * 
			    yv1j - rand1_ .tilts[i__ - 1] * yv2j) * 
			    main2_ .oidpsv[j - 1];
		    main1_ .yv[(j << 1) - 1] += (rand1_ .tiltc[i__ - 1] * 
			    yv2j + rand1_ .tilts[i__ - 1] * yv1j) * 
			    main2_ .oidpsv[j - 1];
 
		}
	    } else {
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    main1_ .yv[(j << 1) - 2] += (rand1_ .tiltc[i__ - 1] * 
			    main1_ .bbiv[(i__ + 1) * 11 - 22] - rand1_ .tilts[
			    i__ - 1] * main1_ .aaiv[(i__ + 1) * 11 - 22]) * 
			    main2_ .oidpsv[j - 1];
		    main1_ .yv[(j << 1) - 1] += (rand1_ .tiltc[i__ - 1] * 
			    main1_ .aaiv[(i__ + 1) * 11 - 22] + rand1_ .tilts[
			    i__ - 1] * main1_ .bbiv[(i__ + 1) * 11 - 22]) * 
			    main2_ .oidpsv[j - 1];
 
		}
	    }
	    goto L640;
 
 
L440:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .yv[(j << 1) - 2] -= track_ .stracks[i__ - 1] * 
			main2_ .oidpsv[j - 1];
		main1_ .yv[(j << 1) - 1] += track_ .strackc[i__ - 1] * 
			main2_ .oidpsv[j - 1];
 
	    }
	    goto L640;
 
L460:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L640;
 
L480:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L640;
 
L500:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L640;
 
L520:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L640;
 
L540:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L640;
 
L560:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L640;
 
L580:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L640;
 
L600:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L640;
 
L620:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		main1_ .xlv[j - 1] = (main1_ .xv[(j << 1) - 2] - main1_ .xsiv[
			i__ - 1]) * rand1_ .tiltc[i__ - 1] + (main1_ .xv[(j <<
			 1) - 1] - main1_ .zsiv[i__ - 1]) * rand1_ .tilts[i__ 
			- 1];
		main1_ .zlv[j - 1] = -(main1_ .xv[(j << 1) - 2] - 
			main1_ .xsiv[i__ - 1]) * rand1_ .tilts[i__ - 1] + (
			main1_ .xv[(j << 1) - 1] - main1_ .zsiv[i__ - 1]) * 
			rand1_ .tiltc[i__ - 1];
		crkve = main1_ .xlv[j - 1];
		cikve = main1_ .zlv[j - 1];
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		crkveuk = crkve * main1_ .xlv[j - 1] - cikve * main1_ .zlv[j 
			- 1];
		cikve = crkve * main1_ .zlv[j - 1] + cikve * main1_ .xlv[j - 
			1];
		crkve = crkveuk;
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * cikve - track_ .stracks[
			i__ - 1] * crkve);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strackc[i__ - 1] * crkve + track_ .stracks[
			i__ - 1] * cikve);
 
	    }
	    goto L640;
L680:
	    i__3 = tra1_ .napx;
	    for (j = 1; j <= i__3; ++j) {
		crkveb[j - 1] = main1_ .xv[(j << 1) - 2] - beam_ .clobeam[(j 
			+ (ix << 6) << 1) - 130] + ell_ .ed[ix - 1];
		cikveb[j - 1] = main1_ .xv[(j << 1) - 1] - beam_ .clobeam[(j 
			+ (ix << 6) << 1) - 129] + ell_ .ek[ix - 1];
		rho2b[j - 1] = crkveb[j - 1] * crkveb[j - 1] + cikveb[j - 1] *
			 cikveb[j - 1];
		if (rho2b[j - 1] <= 1e-17) {
		    goto L690;
		}
		tkb[j - 1] = rho2b[j - 1] / (beam_ .sigman2[(j + (ix << 6) << 
			1) - 130] * 2.);
		main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (
			track_ .strack[i__ - 1] * crkveb[j - 1] / rho2b[j - 1]
			 * (1. - exp(-tkb[j - 1])) - beam_ .beamoff[(j + (ix 
			<< 6) << 1) - 130]);
		main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (
			track_ .strack[i__ - 1] * cikveb[j - 1] / rho2b[j - 1]
			 * (1. - exp(-tkb[j - 1])) - beam_ .beamoff[(j + (ix 
			<< 6) << 1) - 129]);
L690:
		;
	    }
	    goto L640;
L700:
	    if (beam_ .ibtyp == 0) {
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) - 130] 
			    - beam_ .sigman2[(j + (ix << 6) << 1) - 129]) * 
			    2.;
		    rb[j - 1] = sqrt(r2b[j - 1]);
		    rkb[j - 1] = track_ .strack[i__ - 1] * kons_ .pisqrt / rb[
			    j - 1];
		    crkveb[j - 1] = main1_ .xv[(j << 1) - 2] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 130] + ell_ .ed[ix - 1];
		    cikveb[j - 1] = main1_ .xv[(j << 1) - 1] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 129] + ell_ .ek[ix - 1];
		    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    errf_(&xrb[j - 1], &zrb[j - 1], &crxb[j - 1], &crzb[j - 1]
			    );
		    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
			    beam_ .sigman2[(j + (ix << 6) << 1) - 130] + 
			    cikveb[j - 1] * cikveb[j - 1] / beam_ .sigman2[(j 
			    + (ix << 6) << 1) - 129]) / 2.;
		    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 129] * 
			    xrb[j - 1];
		    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 130] * 
			    zrb[j - 1];
		    errf_(&xbb[j - 1], &zbb[j - 1], &cbxb[j - 1], &cbzb[j - 1]
			    );
		    main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) * cbzb[j 
			    - 1]) * d_sign(&c_b2366, &crkveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130]);
		    main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) * cbxb[j 
			    - 1]) * d_sign(&c_b2366, &cikveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129]);
 
		}
	    } else if (beam_ .ibtyp == 1) {
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) - 130] 
			    - beam_ .sigman2[(j + (ix << 6) << 1) - 129]) * 
			    2.;
		    rb[j - 1] = sqrt(r2b[j - 1]);
		    rkb[j - 1] = track_ .strack[i__ - 1] * kons_ .pisqrt / rb[
			    j - 1];
		    crkveb[j - 1] = main1_ .xv[(j << 1) - 2] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 130] + ell_ .ed[ix - 1];
		    cikveb[j - 1] = main1_ .xv[(j << 1) - 1] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 129] + ell_ .ek[ix - 1];
		    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
			    beam_ .sigman2[(j + (ix << 6) << 1) - 130] + 
			    cikveb[j - 1] * cikveb[j - 1] / beam_ .sigman2[(j 
			    + (ix << 6) << 1) - 129]) / 2.;
		    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 129] * 
			    xrb[j - 1];
		    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 130] * 
			    zrb[j - 1];
 
		}
		wzsubv_(& tra1_ .napx, xrb, zrb, crxb, crzb);
		wzsubv_(& tra1_ .napx, xbb, zbb, cbxb, cbzb);
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) * cbzb[j 
			    - 1]) * d_sign(&c_b2366, &crkveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130]);
		    main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) * cbxb[j 
			    - 1]) * d_sign(&c_b2366, &cikveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129]);
 
		}
	    }
	    goto L640;
L720:
	    if (beam_ .ibtyp == 0) {
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) - 129] 
			    - beam_ .sigman2[(j + (ix << 6) << 1) - 130]) * 
			    2.;
		    rb[j - 1] = sqrt(r2b[j - 1]);
		    rkb[j - 1] = track_ .strack[i__ - 1] * kons_ .pisqrt / rb[
			    j - 1];
		    crkveb[j - 1] = main1_ .xv[(j << 1) - 2] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 130] + ell_ .ed[ix - 1];
		    cikveb[j - 1] = main1_ .xv[(j << 1) - 1] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 129] + ell_ .ek[ix - 1];
		    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    errf_(&zrb[j - 1], &xrb[j - 1], &crzb[j - 1], &crxb[j - 1]
			    );
		    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
			    beam_ .sigman2[(j + (ix << 6) << 1) - 130] + 
			    cikveb[j - 1] * cikveb[j - 1] / beam_ .sigman2[(j 
			    + (ix << 6) << 1) - 129]) / 2.;
		    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 129] * 
			    xrb[j - 1];
		    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 130] * 
			    zrb[j - 1];
		    errf_(&zbb[j - 1], &xbb[j - 1], &cbzb[j - 1], &cbxb[j - 1]
			    );
		    main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) * cbzb[j 
			    - 1]) * d_sign(&c_b2366, &crkveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130]);
		    main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) * cbxb[j 
			    - 1]) * d_sign(&c_b2366, &cikveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129]);
 
		}
	    } else if (beam_ .ibtyp == 1) {
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) - 129] 
			    - beam_ .sigman2[(j + (ix << 6) << 1) - 130]) * 
			    2.;
		    rb[j - 1] = sqrt(r2b[j - 1]);
		    rkb[j - 1] = track_ .strack[i__ - 1] * kons_ .pisqrt / rb[
			    j - 1];
		    crkveb[j - 1] = main1_ .xv[(j << 1) - 2] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 130] + ell_ .ed[ix - 1];
		    cikveb[j - 1] = main1_ .xv[(j << 1) - 1] - beam_ .clobeam[
			    (j + (ix << 6) << 1) - 129] + ell_ .ek[ix - 1];
		    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / rb[j - 1]
			    ;
		    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
			    beam_ .sigman2[(j + (ix << 6) << 1) - 130] + 
			    cikveb[j - 1] * cikveb[j - 1] / beam_ .sigman2[(j 
			    + (ix << 6) << 1) - 129]) / 2.;
		    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 129] * 
			    xrb[j - 1];
		    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) - 130] * 
			    zrb[j - 1];
 
		}
		wzsubv_(& tra1_ .napx, zrb, xrb, crzb, crxb);
		wzsubv_(& tra1_ .napx, zbb, xbb, cbzb, cbxb);
		i__3 = tra1_ .napx;
		for (j = 1; j <= i__3; ++j) {
		    main1_ .yv[(j << 1) - 2] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) * cbzb[j 
			    - 1]) * d_sign(&c_b2366, &crkveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130]);
		    main1_ .yv[(j << 1) - 1] += main2_ .oidpsv[j - 1] * (rkb[
			    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) * cbxb[j 
			    - 1]) * d_sign(&c_b2366, &cikveb[j - 1]) - 
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129]);
 
		}
	    }
L640:
	    kpz = (i__3 = ell_ .kp[ix - 1], (( i__3 ) >= 0 ? ( i__3 ) : -( i__3 )) );
	    if (kpz == 0) {
		goto L650;
	    }
	    if (kpz == 1) {
		lostpar2_(&i__, &ix, nthinerr);
		if (*nthinerr != 0) {
		    return 0;
		}
		goto L650;
	    }
	    if (kpz == 3) {
		lostpar3_(&i__, &ix, nthinerr);
		if (*nthinerr != 0) {
		    return 0;
		}
	    }
L650:
	    ;
	}
	lostpart_(nthinerr);
	if (*nthinerr != 0) {
	    return 0;
	}
	if (tra1_ .ntwin != 2) {
	    dist1_();
	}
	if (n % tra1_ .nwr[3] == 0) {
	    write6_(&n);
	}
 
    }
    return 0;
}  

 
 
  int trauthck_(nthinerr)
integer *nthinerr;
{
     
    integer i__1, i__2;
    doublereal d__1, d__2;

     
    double exp(), sqrt(), d_sign();
    integer s_wsfe(), do_fio(), e_wsfe();

     
    static integer i__, j;
    static doublereal r0, rb[64];
    static integer ix, jb, jx, jj;
    static doublereal r0a, r000, r2b[64];
    static integer nbeaux[700];
    static doublereal crkveb[64], cikveb[64], rho2b[64], tkb[64], rkb[64], 
	    xrb[64], zrb[64], xbb[64], zbb[64], crxb[64], crzb[64], cbxb[64], 
	    cbzb[64];
    extern   int error_(), write4_();
    static integer kpz, kzz;
    extern   int errf_(), wzsubv_();
    static integer nmz;
    static doublereal benkcc;
    extern   int thck4d_(), thck6d_(), thck6dua_();

     
    static cilist io___4420 = { 0, 27, 0, "(a16,2x,1p,2d14.6,d17.9)", 0 };
    static cilist io___4426 = { 0, 9, 0, "(a16)", 0 };
    static cilist io___4427 = { 0, 9, 0, "(1p,3d23.15)", 0 };
    static cilist io___4428 = { 0, 9, 0, "(1p,3d23.15)", 0 };
    static cilist io___4429 = { 0, 9, 0, "(1p,3d23.15)", 0 };
    static cilist io___4430 = { 0, 9, 0, "(1p,3d23.15)", 0 };
    static cilist io___4431 = { 0, 9, 0, "(1p,3d23.15)", 0 };
    static cilist io___4432 = { 0, 9, 0, "(1p,3d23.15)", 0 };
    static cilist io___4433 = { 0, 9, 0, "(1p,2d23.15)", 0 };
    static cilist io___4434 = { 0, 9, 0, "(1p,3d23.15)", 0 };
    static cilist io___4435 = { 0, 9, 0, "(1p,3d23.15)", 0 };
    static cilist io___4436 = { 0, 9, 0, "(1p,3d23.15)", 0 };
    static cilist io___4437 = { 0, 9, 0, "(1p,3d23.15)", 0 };
    static cilist io___4438 = { 0, 9, 0, "(1p,3d23.15)", 0 };
    static cilist io___4439 = { 0, 9, 0, "(1p,3d23.15)", 0 };
    static cilist io___4440 = { 0, 9, 0, "(1p,2d23.15)", 0 };


 


 


 
 

 
 

    for (i__ = 1; i__ <= 64; ++i__) {
	main1_ .nlostp[i__ - 1] = i__;
 
    }
    for (i__ = 1; i__ <= 20000; ++i__) {
	track_ .ktrack[i__ - 1] = 0;
	track_ .strack[i__ - 1] = 0.;
	track_ .strackc[i__ - 1] = 0.;
	track_ .stracks[i__ - 1] = 0.;
 
    }
 
    if (beam_ .nbeam >= 1) {
	for (i__ = 1; i__ <= 700; ++i__) {
	    nbeaux[i__ - 1] = 0;
 
	}
	for (ix = 1; ix <= 700; ++ix) {
	    i__1 = tra1_ .napx;
	    for (j = 1; j <= i__1; ++j) {
		if (ell_ .kz[ix - 1] == 20) {
 
		    if (beam_ .sigman[(j + (ix << 6) << 1) - 130] == 
			    beam_ .sigman[(j + (ix << 6) << 1) - 129]) {
			if (nbeaux[ix - 1] == 2 || nbeaux[ix - 1] == 3) {
			    error_(&c__89);
			} else {
			    nbeaux[ix - 1] = 1;
 
			    d__1 = beam_ .sigman[(j + (ix << 6) << 1) - 130];
			    beam_ .sigman2[(j + (ix << 6) << 1) - 130] = d__1 
				    * d__1;
			}
		    }
 
		    if (beam_ .sigman[(j + (ix << 6) << 1) - 130] > 
			    beam_ .sigman[(j + (ix << 6) << 1) - 129]) {
			if (nbeaux[ix - 1] == 1 || nbeaux[ix - 1] == 3) {
			    error_(&c__89);
			} else {
			    nbeaux[ix - 1] = 2;
 
			    d__1 = beam_ .sigman[(j + (ix << 6) << 1) - 130];
			    beam_ .sigman2[(j + (ix << 6) << 1) - 130] = d__1 
				    * d__1;
 
			    d__1 = beam_ .sigman[(j + (ix << 6) << 1) - 129];
			    beam_ .sigman2[(j + (ix << 6) << 1) - 129] = d__1 
				    * d__1;
			    beam_ .sigmanq[(j + (ix << 6) << 1) - 130] = 
				    beam_ .sigman[(j + (ix << 6) << 1) - 130] 
				    / beam_ .sigman[(j + (ix << 6) << 1) - 
				    129];
			    beam_ .sigmanq[(j + (ix << 6) << 1) - 129] = 
				    beam_ .sigman[(j + (ix << 6) << 1) - 129] 
				    / beam_ .sigman[(j + (ix << 6) << 1) - 
				    130];
			}
		    }
 
		    if (beam_ .sigman[(j + (ix << 6) << 1) - 130] < 
			    beam_ .sigman[(j + (ix << 6) << 1) - 129]) {
			if (nbeaux[ix - 1] == 1 || nbeaux[ix - 1] == 2) {
			    error_(&c__89);
			} else {
			    nbeaux[ix - 1] = 3;
 
			    d__1 = beam_ .sigman[(j + (ix << 6) << 1) - 130];
			    beam_ .sigman2[(j + (ix << 6) << 1) - 130] = d__1 
				    * d__1;
 
			    d__1 = beam_ .sigman[(j + (ix << 6) << 1) - 129];
			    beam_ .sigman2[(j + (ix << 6) << 1) - 129] = d__1 
				    * d__1;
			    beam_ .sigmanq[(j + (ix << 6) << 1) - 130] = 
				    beam_ .sigman[(j + (ix << 6) << 1) - 130] 
				    / beam_ .sigman[(j + (ix << 6) << 1) - 
				    129];
			    beam_ .sigmanq[(j + (ix << 6) << 1) - 129] = 
				    beam_ .sigman[(j + (ix << 6) << 1) - 129] 
				    / beam_ .sigman[(j + (ix << 6) << 1) - 
				    130];
			}
		    }
		}
 
	    }
	}
    }
    i__1 = str_ .iu;
    for (i__ = 1; i__ <= i__1; ++i__) {
	if (rand1_ .mout2 == 1 && i__ == 1) {
	    write4_();
	}
	ix = str_ .ic[i__ - 1];
	if (ix > 300) {
	    goto L30;
	}
	track_ .ktrack[i__ - 1] = 1;
	i__2 = str2_ .mel[ix - 1];
	for (jb = 1; jb <= i__2; ++jb) {
	    jx = str2_ .mtyp[ix + jb * 300 - 301];
	    track_ .strack[i__ - 1] += ell_ .el[jx - 1];
 
	}
	if ((d__1 = track_ .strack[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	}
	goto L290;
L30:
	ix += -300;
	kpz = (i__2 = ell_ .kp[ix - 1], (( i__2 ) >= 0 ? ( i__2 ) : -( i__2 )) );
	if (kpz == 6) {
	    track_ .ktrack[i__ - 1] = 2;
	    goto L290;
	}
 
	kzz = ell_ .kz[ix - 1];
	if (kzz == 0) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
 
	if (kzz == 20 && beam_ .nbeam >= 1) {
	    track_ .strack[i__ - 1] = syn_ .crad * 2. * beam_ .partnum * 
		    beam_ .gammar * 1e6;
	    if ((d__1 = track_ .strack[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
		track_ .ktrack[i__ - 1] = 31;
		goto L290;
	    }
	    if (nbeaux[ix - 1] == 1) {
		track_ .ktrack[i__ - 1] = 41;
		if (beam_ .ibeco == 1) {
		    i__2 = tra1_ .napx;
		    for (j = 1; j <= i__2; ++j) {
			crkveb[j - 1] = ell_ .ed[ix - 1];
			cikveb[j - 1] = ell_ .ek[ix - 1];
			rho2b[j - 1] = crkveb[j - 1] * crkveb[j - 1] + cikveb[
				j - 1] * cikveb[j - 1];
			if (rho2b[j - 1] <= 1e-17) {
			    goto L42;
			}
			tkb[j - 1] = rho2b[j - 1] / (beam_ .sigman2[(j + (ix 
				<< 6) << 1) - 130] * 2.);
			beam_ .beamoff[(j + (ix << 6) << 1) - 130] = 
				track_ .strack[i__ - 1] * crkveb[j - 1] / 
				rho2b[j - 1] * (1. - exp(-tkb[j - 1]));
			beam_ .beamoff[(j + (ix << 6) << 1) - 129] = 
				track_ .strack[i__ - 1] * cikveb[j - 1] / 
				rho2b[j - 1] * (1. - exp(-tkb[j - 1]));
L42:
			;
		    }
		}
	    }
	    if (nbeaux[ix - 1] == 2) {
		track_ .ktrack[i__ - 1] = 42;
		if (beam_ .ibeco == 1) {
		    if (beam_ .ibtyp == 0) {
			i__2 = tra1_ .napx;
			for (j = 1; j <= i__2; ++j) {
			    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) 
				    - 130] - beam_ .sigman2[(j + (ix << 6) << 
				    1) - 129]) * 2.;
			    rb[j - 1] = sqrt(r2b[j - 1]);
			    rkb[j - 1] = track_ .strack[i__ - 1] * 
				    kons_ .pisqrt / rb[j - 1];
			    crkveb[j - 1] = ell_ .ed[ix - 1];
			    cikveb[j - 1] = ell_ .ek[ix - 1];
			    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / 
				    rb[j - 1];
			    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / 
				    rb[j - 1];
			    errf_(&xrb[j - 1], &zrb[j - 1], &crxb[j - 1], &
				    crzb[j - 1]);
			    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
				    beam_ .sigman2[(j + (ix << 6) << 1) - 130]
				     + cikveb[j - 1] * cikveb[j - 1] / 
				    beam_ .sigman2[(j + (ix << 6) << 1) - 129]
				    ) / 2.;
			    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) 
				    - 129] * xrb[j - 1];
			    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) 
				    - 130] * zrb[j - 1];
			    errf_(&xbb[j - 1], &zbb[j - 1], &cbxb[j - 1], &
				    cbzb[j - 1]);
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130] = rkb[
				    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) *
				     cbzb[j - 1]) * d_sign(&c_b2366, &crkveb[
				    j - 1]);
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129] = rkb[
				    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) *
				     cbxb[j - 1]) * d_sign(&c_b2366, &cikveb[
				    j - 1]);
 
			}
		    } else if (beam_ .ibtyp == 1) {
			i__2 = tra1_ .napx;
			for (j = 1; j <= i__2; ++j) {
			    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) 
				    - 130] - beam_ .sigman2[(j + (ix << 6) << 
				    1) - 129]) * 2.;
			    rb[j - 1] = sqrt(r2b[j - 1]);
			    rkb[j - 1] = track_ .strack[i__ - 1] * 
				    kons_ .pisqrt / rb[j - 1];
			    crkveb[j - 1] = ell_ .ed[ix - 1];
			    cikveb[j - 1] = ell_ .ek[ix - 1];
			    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / 
				    rb[j - 1];
			    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / 
				    rb[j - 1];
			    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
				    beam_ .sigman2[(j + (ix << 6) << 1) - 130]
				     + cikveb[j - 1] * cikveb[j - 1] / 
				    beam_ .sigman2[(j + (ix << 6) << 1) - 129]
				    ) / 2.;
			    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) 
				    - 129] * xrb[j - 1];
			    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) 
				    - 130] * zrb[j - 1];
 
			}
			wzsubv_(& tra1_ .napx, xrb, zrb, crxb, crzb);
			wzsubv_(& tra1_ .napx, xbb, zbb, cbxb, cbzb);
			i__2 = tra1_ .napx;
			for (j = 1; j <= i__2; ++j) {
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130] = rkb[
				    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) *
				     cbzb[j - 1]) * d_sign(&c_b2366, &crkveb[
				    j - 1]);
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129] = rkb[
				    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) *
				     cbxb[j - 1]) * d_sign(&c_b2366, &cikveb[
				    j - 1]);
 
			}
		    }
		}
	    }
	    if (nbeaux[ix - 1] == 3) {
		track_ .ktrack[i__ - 1] = 43;
		if (beam_ .ibeco == 1) {
		    if (beam_ .ibtyp == 0) {
			i__2 = tra1_ .napx;
			for (j = 1; j <= i__2; ++j) {
			    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) 
				    - 129] - beam_ .sigman2[(j + (ix << 6) << 
				    1) - 130]) * 2.;
			    rb[j - 1] = sqrt(r2b[j - 1]);
			    rkb[j - 1] = track_ .strack[i__ - 1] * 
				    kons_ .pisqrt / rb[j - 1];
			    crkveb[j - 1] = ell_ .ed[ix - 1];
			    cikveb[j - 1] = ell_ .ek[ix - 1];
			    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / 
				    rb[j - 1];
			    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / 
				    rb[j - 1];
			    errf_(&zrb[j - 1], &xrb[j - 1], &crzb[j - 1], &
				    crxb[j - 1]);
			    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
				    beam_ .sigman2[(j + (ix << 6) << 1) - 130]
				     + cikveb[j - 1] * cikveb[j - 1] / 
				    beam_ .sigman2[(j + (ix << 6) << 1) - 129]
				    ) / 2.;
			    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) 
				    - 129] * xrb[j - 1];
			    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) 
				    - 130] * zrb[j - 1];
			    errf_(&zbb[j - 1], &xbb[j - 1], &cbzb[j - 1], &
				    cbxb[j - 1]);
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130] = rkb[
				    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) *
				     cbzb[j - 1]) * d_sign(&c_b2366, &crkveb[
				    j - 1]);
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129] = rkb[
				    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) *
				     cbxb[j - 1]) * d_sign(&c_b2366, &cikveb[
				    j - 1]);
 
			}
		    } else if (beam_ .ibtyp == 1) {
			i__2 = tra1_ .napx;
			for (j = 1; j <= i__2; ++j) {
			    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) 
				    - 129] - beam_ .sigman2[(j + (ix << 6) << 
				    1) - 130]) * 2.;
			    rb[j - 1] = sqrt(r2b[j - 1]);
			    rkb[j - 1] = track_ .strack[i__ - 1] * 
				    kons_ .pisqrt / rb[j - 1];
			    crkveb[j - 1] = ell_ .ed[ix - 1];
			    cikveb[j - 1] = ell_ .ek[ix - 1];
			    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / 
				    rb[j - 1];
			    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / 
				    rb[j - 1];
			    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
				    beam_ .sigman2[(j + (ix << 6) << 1) - 130]
				     + cikveb[j - 1] * cikveb[j - 1] / 
				    beam_ .sigman2[(j + (ix << 6) << 1) - 129]
				    ) / 2.;
			    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) 
				    - 129] * xrb[j - 1];
			    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) 
				    - 130] * zrb[j - 1];
 
			}
			wzsubv_(& tra1_ .napx, zrb, xrb, crzb, crxb);
			wzsubv_(& tra1_ .napx, zbb, xbb, cbzb, cbxb);
			i__2 = tra1_ .napx;
			for (j = 1; j <= i__2; ++j) {
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130] = rkb[
				    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) *
				     cbzb[j - 1]) * d_sign(&c_b2366, &crkveb[
				    j - 1]);
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129] = rkb[
				    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) *
				     cbxb[j - 1]) * d_sign(&c_b2366, &cikveb[
				    j - 1]);
 
			}
		    }
		}
	    }
	    goto L290;
	}
	if (rand1_ .mout2 == 1 && rand1_ .icextal[i__ - 1] != 0) {
	    s_wsfe(&io___4420);
	    do_fio(&c__1, linopc_ .bez + (ix - 1 << 4), 16L);
	    do_fio(&c__1, (char *)& rand1_ .extalign[i__ - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& rand1_ .extalign[i__ + 19999], (ftnlen)
		    sizeof(doublereal));
	    do_fio(&c__1, (char *)& rand1_ .extalign[i__ + 39999], (ftnlen)
		    sizeof(doublereal));
	    e_wsfe();
	}
	if (kzz < 0) {
	    goto L180;
	}
	switch ((int)kzz) {
	    case 1:  goto L50;
	    case 2:  goto L60;
	    case 3:  goto L70;
	    case 4:  goto L80;
	    case 5:  goto L90;
	    case 6:  goto L100;
	    case 7:  goto L110;
	    case 8:  goto L120;
	    case 9:  goto L130;
	    case 10:  goto L140;
	    case 11:  goto L150;
	}
	track_ .ktrack[i__ - 1] = 31;
	goto L290;
L50:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 11;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e3;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L60:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 12;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1];
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L70:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 13;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * .001;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L80:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 14;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e-6;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L90:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 15;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e-9;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L100:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 16;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e-12;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L110:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 17;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e-15;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L120:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 18;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e-18;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L130:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 19;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e-21;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L140:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 20;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e-24;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L150:
	r0 = ell_ .ek[ix - 1];
	nmz = mult1_ .nmu[ix - 1];
	if ((( r0 ) >= 0 ? ( r0 ) : -( r0 ))  <= 1e-17 || nmz == 0) {
	    if ((d__1 = dkic_ .dki[ix - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17 && (d__2 = 
		    dkic_ .dki[ix + 699], (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) ) <= 1e-17) {
		track_ .ktrack[i__ - 1] = 31;
	    } else if ((d__1 = dkic_ .dki[ix - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17 && (
		    d__2 = dkic_ .dki[ix + 699], (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) ) <= 1e-17) {
		if ((d__1 = dkic_ .dki[ix + 1399], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		    track_ .ktrack[i__ - 1] = 33;
		    track_ .strack[i__ - 1] = dkic_ .dki[ix - 1] / dkic_ .dki[
			    ix + 1399];
		    track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tiltc[i__ - 1];
		    track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tilts[i__ - 1];
		} else {
		    track_ .ktrack[i__ - 1] = 35;
		    track_ .strack[i__ - 1] = dkic_ .dki[ix - 1];
		    track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tiltc[i__ - 1];
		    track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tilts[i__ - 1];
		}
	    } else if ((d__1 = dkic_ .dki[ix - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17 && (
		    d__2 = dkic_ .dki[ix + 699], (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) ) > 1e-17) {
		if ((d__1 = dkic_ .dki[ix + 1399], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		    track_ .ktrack[i__ - 1] = 37;
		    track_ .strack[i__ - 1] = dkic_ .dki[ix + 699] / 
			    dkic_ .dki[ix + 1399];
		    track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tiltc[i__ - 1];
		    track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tilts[i__ - 1];
		} else {
		    track_ .ktrack[i__ - 1] = 39;
		    track_ .strack[i__ - 1] = dkic_ .dki[ix + 699];
		    track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tiltc[i__ - 1];
		    track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tilts[i__ - 1];
		}
	    }
	} else {
	    if ((d__1 = dkic_ .dki[ix - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17 && (d__2 = 
		    dkic_ .dki[ix + 699], (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) ) <= 1e-17) {
		track_ .ktrack[i__ - 1] = 32;
	    } else if ((d__1 = dkic_ .dki[ix - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17 && (
		    d__2 = dkic_ .dki[ix + 699], (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) ) <= 1e-17) {
		if ((d__1 = dkic_ .dki[ix + 1399], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		    track_ .ktrack[i__ - 1] = 34;
		    track_ .strack[i__ - 1] = dkic_ .dki[ix - 1] / dkic_ .dki[
			    ix + 1399];
		    track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tiltc[i__ - 1];
		    track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tilts[i__ - 1];
		} else {
		    track_ .ktrack[i__ - 1] = 36;
		    track_ .strack[i__ - 1] = dkic_ .dki[ix - 1];
		    track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tiltc[i__ - 1];
		    track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tilts[i__ - 1];
		}
	    } else if ((d__1 = dkic_ .dki[ix - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17 && (
		    d__2 = dkic_ .dki[ix + 699], (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) ) > 1e-17) {
		if ((d__1 = dkic_ .dki[ix + 1399], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		    track_ .ktrack[i__ - 1] = 38;
		    track_ .strack[i__ - 1] = dkic_ .dki[ix + 699] / 
			    dkic_ .dki[ix + 1399];
		    track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tiltc[i__ - 1];
		    track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tilts[i__ - 1];
		} else {
		    track_ .ktrack[i__ - 1] = 40;
		    track_ .strack[i__ - 1] = dkic_ .dki[ix + 699];
		    track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tiltc[i__ - 1];
		    track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tilts[i__ - 1];
		}
	    }
	}
	if ((( r0 ) >= 0 ? ( r0 ) : -( r0 ))  <= 1e-17 || nmz == 0) {
	    goto L290;
	}
	if (rand1_ .mout2 == 1) {
	    benkcc = ell_ .ed[ix - 1] * mult1_ .benkc[mult1_ .irm[ix - 1] - 1]
		    ;
	    r0a = 1.;
	    r000 = r0 * mult1_ .r00[mult1_ .irm[ix - 1] - 1];
	    for (j = 1; j <= 11; ++j) {
		main3_ .fake[(j << 1) - 2] = main1_ .bbiv[j + (i__ + 1) * 11 
			- 23] * r0a / benkcc;
		main3_ .fake[(j << 1) - 1] = main1_ .aaiv[j + (i__ + 1) * 11 
			- 23] * r0a / benkcc;
 
		r0a *= r000;
	    }
	    s_wsfe(&io___4426);
	    do_fio(&c__1, linopc_ .bez + (ix - 1 << 4), 16L);
	    e_wsfe();
	    s_wsfe(&io___4427);
	    for (j = 1; j <= 3; ++j) {
		do_fio(&c__1, (char *)& main3_ .fake[(j << 1) - 2], (ftnlen)
			sizeof(doublereal));
	    }
	    e_wsfe();
	    s_wsfe(&io___4428);
	    for (j = 4; j <= 6; ++j) {
		do_fio(&c__1, (char *)& main3_ .fake[(j << 1) - 2], (ftnlen)
			sizeof(doublereal));
	    }
	    e_wsfe();
	    s_wsfe(&io___4429);
	    for (j = 7; j <= 9; ++j) {
		do_fio(&c__1, (char *)& main3_ .fake[(j << 1) - 2], (ftnlen)
			sizeof(doublereal));
	    }
	    e_wsfe();
	    s_wsfe(&io___4430);
	    for (j = 10; j <= 12; ++j) {
		do_fio(&c__1, (char *)& main3_ .fake[(j << 1) - 2], (ftnlen)
			sizeof(doublereal));
	    }
	    e_wsfe();
	    s_wsfe(&io___4431);
	    for (j = 13; j <= 15; ++j) {
		do_fio(&c__1, (char *)& main3_ .fake[(j << 1) - 2], (ftnlen)
			sizeof(doublereal));
	    }
	    e_wsfe();
	    s_wsfe(&io___4432);
	    for (j = 16; j <= 18; ++j) {
		do_fio(&c__1, (char *)& main3_ .fake[(j << 1) - 2], (ftnlen)
			sizeof(doublereal));
	    }
	    e_wsfe();
	    s_wsfe(&io___4433);
	    for (j = 19; j <= 20; ++j) {
		do_fio(&c__1, (char *)& main3_ .fake[(j << 1) - 2], (ftnlen)
			sizeof(doublereal));
	    }
	    e_wsfe();
	    s_wsfe(&io___4434);
	    for (j = 1; j <= 3; ++j) {
		do_fio(&c__1, (char *)& main3_ .fake[(j << 1) - 1], (ftnlen)
			sizeof(doublereal));
	    }
	    e_wsfe();
	    s_wsfe(&io___4435);
	    for (j = 4; j <= 6; ++j) {
		do_fio(&c__1, (char *)& main3_ .fake[(j << 1) - 1], (ftnlen)
			sizeof(doublereal));
	    }
	    e_wsfe();
	    s_wsfe(&io___4436);
	    for (j = 7; j <= 9; ++j) {
		do_fio(&c__1, (char *)& main3_ .fake[(j << 1) - 1], (ftnlen)
			sizeof(doublereal));
	    }
	    e_wsfe();
	    s_wsfe(&io___4437);
	    for (j = 10; j <= 12; ++j) {
		do_fio(&c__1, (char *)& main3_ .fake[(j << 1) - 1], (ftnlen)
			sizeof(doublereal));
	    }
	    e_wsfe();
	    s_wsfe(&io___4438);
	    for (j = 13; j <= 15; ++j) {
		do_fio(&c__1, (char *)& main3_ .fake[(j << 1) - 1], (ftnlen)
			sizeof(doublereal));
	    }
	    e_wsfe();
	    s_wsfe(&io___4439);
	    for (j = 16; j <= 18; ++j) {
		do_fio(&c__1, (char *)& main3_ .fake[(j << 1) - 1], (ftnlen)
			sizeof(doublereal));
	    }
	    e_wsfe();
	    s_wsfe(&io___4440);
	    for (j = 19; j <= 20; ++j) {
		do_fio(&c__1, (char *)& main3_ .fake[(j << 1) - 1], (ftnlen)
			sizeof(doublereal));
	    }
	    e_wsfe();
	    for (j = 1; j <= 20; ++j) {
		main3_ .fake[(j << 1) - 2] = 0.;
 
		main3_ .fake[(j << 1) - 1] = 0.;
	    }
	}
	goto L290;
L180:
	kzz = -kzz;
	switch ((int)kzz) {
	    case 1:  goto L190;
	    case 2:  goto L200;
	    case 3:  goto L210;
	    case 4:  goto L220;
	    case 5:  goto L230;
	    case 6:  goto L240;
	    case 7:  goto L250;
	    case 8:  goto L260;
	    case 9:  goto L270;
	    case 10:  goto L280;
	}
	track_ .ktrack[i__ - 1] = 31;
	goto L290;
L190:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 21;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e3;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L200:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 22;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1];
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L210:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 23;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * .001;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L220:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 24;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e-6;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L230:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 25;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e-9;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L240:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 26;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e-12;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L250:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 27;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e-15;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L260:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 28;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e-18;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L270:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 29;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e-21;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L280:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 30;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e-24;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
L290:
	;
    }
    i__1 = tra1_ .napx;
    for (j = 1; j <= i__1; ++j) {
	track_ .dpsv1[j - 1] = main1_ .dpsv[j - 1] * 1e3 / (main1_ .dpsv[j - 
		1] + 1.);
 
    }
    track_ .nwri = tra1_ .nwr[2];
    if (track_ .nwri == 0) {
	track_ .nwri = tra1_ .numl + tra1_ .numlr + 1;
    }
    if (syn_ .idp == 0 || syn_ .ition == 0) {
	thck4d_(nthinerr);
    } else {
	syn_ .hsy[2] = syn_ .hsy[2] * .001 * syn_ .ition;
	for (jj = 1; jj <= 700; ++jj) {
	    if (ell_ .kz[jj - 1] == 12) {
		syn_ .hsyc[jj - 1] = syn_ .hsyc[jj - 1] * .001 * syn_ .itionc[
			jj - 1];
	    }
 
	}
	if ((( syn_ .phas ) >= 0 ? ( syn_ .phas ) : -( syn_ .phas ))  >= 1e-17) {
	    thck6dua_(nthinerr);
	} else {
	    thck6d_(nthinerr);
	}
    }
    return 0;
}  

 
 
  int trauthin_(nthinerr)
integer *nthinerr;
{
     
    integer i__1, i__2;
    doublereal d__1, d__2;

     
    double exp(), sqrt(), d_sign();
    integer s_wsfe(), do_fio(), e_wsfe();

     
    extern   int thin6dua_();
    static integer i__, j;
    static doublereal r0, rb[64];
    static integer ix, jb, jx, jj;
    static doublereal r0a, r000, r2b[64];
    static integer nbeaux[700];
    static doublereal crkveb[64], cikveb[64], rho2b[64], tkb[64], rkb[64], 
	    xrb[64], zrb[64], xbb[64], zbb[64], crxb[64], crzb[64], cbxb[64], 
	    cbzb[64];
    extern   int error_(), write4_();
    static integer kpz, kzz;
    extern   int errf_(), wzsubv_();
    static integer nmz;
    static doublereal benkcc;
    extern   int thin4d_(), thin6d_();

     
    static cilist io___4465 = { 0, 27, 0, "(a16,2x,1p,2d14.6,d17.9)", 0 };
    static cilist io___4471 = { 0, 9, 0, "(a16)", 0 };
    static cilist io___4472 = { 0, 9, 0, "(1p,3d23.15)", 0 };
    static cilist io___4473 = { 0, 9, 0, "(1p,3d23.15)", 0 };
    static cilist io___4474 = { 0, 9, 0, "(1p,3d23.15)", 0 };
    static cilist io___4475 = { 0, 9, 0, "(1p,3d23.15)", 0 };
    static cilist io___4476 = { 0, 9, 0, "(1p,3d23.15)", 0 };
    static cilist io___4477 = { 0, 9, 0, "(1p,3d23.15)", 0 };
    static cilist io___4478 = { 0, 9, 0, "(1p,2d23.15)", 0 };
    static cilist io___4479 = { 0, 9, 0, "(1p,3d23.15)", 0 };
    static cilist io___4480 = { 0, 9, 0, "(1p,3d23.15)", 0 };
    static cilist io___4481 = { 0, 9, 0, "(1p,3d23.15)", 0 };
    static cilist io___4482 = { 0, 9, 0, "(1p,3d23.15)", 0 };
    static cilist io___4483 = { 0, 9, 0, "(1p,3d23.15)", 0 };
    static cilist io___4484 = { 0, 9, 0, "(1p,3d23.15)", 0 };
    static cilist io___4485 = { 0, 9, 0, "(1p,2d23.15)", 0 };


 


 


 
 

 
 

    for (i__ = 1; i__ <= 64; ++i__) {
	main1_ .nlostp[i__ - 1] = i__;
 
    }
    for (i__ = 1; i__ <= 20000; ++i__) {
	track_ .ktrack[i__ - 1] = 0;
	track_ .strack[i__ - 1] = 0.;
	track_ .strackc[i__ - 1] = 0.;
	track_ .stracks[i__ - 1] = 0.;
 
    }
 
    if (beam_ .nbeam >= 1) {
	for (i__ = 1; i__ <= 700; ++i__) {
	    nbeaux[i__ - 1] = 0;
 
	}
	for (ix = 1; ix <= 700; ++ix) {
	    i__1 = tra1_ .napx;
	    for (j = 1; j <= i__1; ++j) {
		if (ell_ .kz[ix - 1] == 20) {
 
		    if (beam_ .sigman[(j + (ix << 6) << 1) - 130] == 
			    beam_ .sigman[(j + (ix << 6) << 1) - 129]) {
			if (nbeaux[ix - 1] == 2 || nbeaux[ix - 1] == 3) {
			    error_(&c__89);
			} else {
			    nbeaux[ix - 1] = 1;
 
			    d__1 = beam_ .sigman[(j + (ix << 6) << 1) - 130];
			    beam_ .sigman2[(j + (ix << 6) << 1) - 130] = d__1 
				    * d__1;
			}
		    }
 
		    if (beam_ .sigman[(j + (ix << 6) << 1) - 130] > 
			    beam_ .sigman[(j + (ix << 6) << 1) - 129]) {
			if (nbeaux[ix - 1] == 1 || nbeaux[ix - 1] == 3) {
			    error_(&c__89);
			} else {
			    nbeaux[ix - 1] = 2;
 
			    d__1 = beam_ .sigman[(j + (ix << 6) << 1) - 130];
			    beam_ .sigman2[(j + (ix << 6) << 1) - 130] = d__1 
				    * d__1;
 
			    d__1 = beam_ .sigman[(j + (ix << 6) << 1) - 129];
			    beam_ .sigman2[(j + (ix << 6) << 1) - 129] = d__1 
				    * d__1;
			    beam_ .sigmanq[(j + (ix << 6) << 1) - 130] = 
				    beam_ .sigman[(j + (ix << 6) << 1) - 130] 
				    / beam_ .sigman[(j + (ix << 6) << 1) - 
				    129];
			    beam_ .sigmanq[(j + (ix << 6) << 1) - 129] = 
				    beam_ .sigman[(j + (ix << 6) << 1) - 129] 
				    / beam_ .sigman[(j + (ix << 6) << 1) - 
				    130];
			}
		    }
 
		    if (beam_ .sigman[(j + (ix << 6) << 1) - 130] < 
			    beam_ .sigman[(j + (ix << 6) << 1) - 129]) {
			if (nbeaux[ix - 1] == 1 || nbeaux[ix - 1] == 2) {
			    error_(&c__89);
			} else {
			    nbeaux[ix - 1] = 3;
 
			    d__1 = beam_ .sigman[(j + (ix << 6) << 1) - 130];
			    beam_ .sigman2[(j + (ix << 6) << 1) - 130] = d__1 
				    * d__1;
 
			    d__1 = beam_ .sigman[(j + (ix << 6) << 1) - 129];
			    beam_ .sigman2[(j + (ix << 6) << 1) - 129] = d__1 
				    * d__1;
			    beam_ .sigmanq[(j + (ix << 6) << 1) - 130] = 
				    beam_ .sigman[(j + (ix << 6) << 1) - 130] 
				    / beam_ .sigman[(j + (ix << 6) << 1) - 
				    129];
			    beam_ .sigmanq[(j + (ix << 6) << 1) - 129] = 
				    beam_ .sigman[(j + (ix << 6) << 1) - 129] 
				    / beam_ .sigman[(j + (ix << 6) << 1) - 
				    130];
			}
		    }
		}
 
	    }
	}
    }
    i__1 = str_ .iu;
    for (i__ = 1; i__ <= i__1; ++i__) {
	if (rand1_ .mout2 == 1 && i__ == 1) {
	    write4_();
	}
	ix = str_ .ic[i__ - 1];
	if (ix > 300) {
	    goto L30;
	}
	track_ .ktrack[i__ - 1] = 1;
	i__2 = str2_ .mel[ix - 1];
	for (jb = 1; jb <= i__2; ++jb) {
	    jx = str2_ .mtyp[ix + jb * 300 - 301];
	    track_ .strack[i__ - 1] += ell_ .el[jx - 1];
 
	}
	if ((d__1 = track_ .strack[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	}
	goto L290;
L30:
	ix += -300;
	kpz = (i__2 = ell_ .kp[ix - 1], (( i__2 ) >= 0 ? ( i__2 ) : -( i__2 )) );
	if (kpz == 6) {
	    track_ .ktrack[i__ - 1] = 2;
	    goto L290;
	}
 
	kzz = ell_ .kz[ix - 1];
	if (kzz == 0) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
 
	if (kzz == 20 && beam_ .nbeam >= 1) {
	    track_ .strack[i__ - 1] = syn_ .crad * 2. * beam_ .partnum * 
		    beam_ .gammar * 1e6;
	    if ((d__1 = track_ .strack[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
		track_ .ktrack[i__ - 1] = 31;
		goto L290;
	    }
	    if (nbeaux[ix - 1] == 1) {
		track_ .ktrack[i__ - 1] = 41;
		if (beam_ .ibeco == 1) {
		    i__2 = tra1_ .napx;
		    for (j = 1; j <= i__2; ++j) {
			crkveb[j - 1] = ell_ .ed[ix - 1];
			cikveb[j - 1] = ell_ .ek[ix - 1];
			rho2b[j - 1] = crkveb[j - 1] * crkveb[j - 1] + cikveb[
				j - 1] * cikveb[j - 1];
			if (rho2b[j - 1] <= 1e-17) {
			    goto L42;
			}
			tkb[j - 1] = rho2b[j - 1] / (beam_ .sigman2[(j + (ix 
				<< 6) << 1) - 130] * 2.);
			beam_ .beamoff[(j + (ix << 6) << 1) - 130] = 
				track_ .strack[i__ - 1] * crkveb[j - 1] / 
				rho2b[j - 1] * (1. - exp(-tkb[j - 1]));
			beam_ .beamoff[(j + (ix << 6) << 1) - 129] = 
				track_ .strack[i__ - 1] * cikveb[j - 1] / 
				rho2b[j - 1] * (1. - exp(-tkb[j - 1]));
L42:
			;
		    }
		}
	    }
	    if (nbeaux[ix - 1] == 2) {
		track_ .ktrack[i__ - 1] = 42;
		if (beam_ .ibeco == 1) {
		    if (beam_ .ibtyp == 0) {
			i__2 = tra1_ .napx;
			for (j = 1; j <= i__2; ++j) {
			    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) 
				    - 130] - beam_ .sigman2[(j + (ix << 6) << 
				    1) - 129]) * 2.;
			    rb[j - 1] = sqrt(r2b[j - 1]);
			    rkb[j - 1] = track_ .strack[i__ - 1] * 
				    kons_ .pisqrt / rb[j - 1];
			    crkveb[j - 1] = ell_ .ed[ix - 1];
			    cikveb[j - 1] = ell_ .ek[ix - 1];
			    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / 
				    rb[j - 1];
			    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / 
				    rb[j - 1];
			    errf_(&xrb[j - 1], &zrb[j - 1], &crxb[j - 1], &
				    crzb[j - 1]);
			    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
				    beam_ .sigman2[(j + (ix << 6) << 1) - 130]
				     + cikveb[j - 1] * cikveb[j - 1] / 
				    beam_ .sigman2[(j + (ix << 6) << 1) - 129]
				    ) / 2.;
			    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) 
				    - 129] * xrb[j - 1];
			    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) 
				    - 130] * zrb[j - 1];
			    errf_(&xbb[j - 1], &zbb[j - 1], &cbxb[j - 1], &
				    cbzb[j - 1]);
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130] = rkb[
				    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) *
				     cbzb[j - 1]) * d_sign(&c_b2366, &crkveb[
				    j - 1]);
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129] = rkb[
				    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) *
				     cbxb[j - 1]) * d_sign(&c_b2366, &cikveb[
				    j - 1]);
 
			}
		    } else if (beam_ .ibtyp == 1) {
			i__2 = tra1_ .napx;
			for (j = 1; j <= i__2; ++j) {
			    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) 
				    - 130] - beam_ .sigman2[(j + (ix << 6) << 
				    1) - 129]) * 2.;
			    rb[j - 1] = sqrt(r2b[j - 1]);
			    rkb[j - 1] = track_ .strack[i__ - 1] * 
				    kons_ .pisqrt / rb[j - 1];
			    crkveb[j - 1] = ell_ .ed[ix - 1];
			    cikveb[j - 1] = ell_ .ek[ix - 1];
			    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / 
				    rb[j - 1];
			    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / 
				    rb[j - 1];
			    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
				    beam_ .sigman2[(j + (ix << 6) << 1) - 130]
				     + cikveb[j - 1] * cikveb[j - 1] / 
				    beam_ .sigman2[(j + (ix << 6) << 1) - 129]
				    ) / 2.;
			    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) 
				    - 129] * xrb[j - 1];
			    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) 
				    - 130] * zrb[j - 1];
 
			}
			wzsubv_(& tra1_ .napx, xrb, zrb, crxb, crzb);
			wzsubv_(& tra1_ .napx, xbb, zbb, cbxb, cbzb);
			i__2 = tra1_ .napx;
			for (j = 1; j <= i__2; ++j) {
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130] = rkb[
				    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) *
				     cbzb[j - 1]) * d_sign(&c_b2366, &crkveb[
				    j - 1]);
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129] = rkb[
				    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) *
				     cbxb[j - 1]) * d_sign(&c_b2366, &cikveb[
				    j - 1]);
 
			}
		    }
		}
	    }
	    if (nbeaux[ix - 1] == 3) {
		track_ .ktrack[i__ - 1] = 43;
		if (beam_ .ibeco == 1) {
		    if (beam_ .ibtyp == 0) {
			i__2 = tra1_ .napx;
			for (j = 1; j <= i__2; ++j) {
			    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) 
				    - 129] - beam_ .sigman2[(j + (ix << 6) << 
				    1) - 130]) * 2.;
			    rb[j - 1] = sqrt(r2b[j - 1]);
			    rkb[j - 1] = track_ .strack[i__ - 1] * 
				    kons_ .pisqrt / rb[j - 1];
			    crkveb[j - 1] = ell_ .ed[ix - 1];
			    cikveb[j - 1] = ell_ .ek[ix - 1];
			    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / 
				    rb[j - 1];
			    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / 
				    rb[j - 1];
			    errf_(&zrb[j - 1], &xrb[j - 1], &crzb[j - 1], &
				    crxb[j - 1]);
			    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
				    beam_ .sigman2[(j + (ix << 6) << 1) - 130]
				     + cikveb[j - 1] * cikveb[j - 1] / 
				    beam_ .sigman2[(j + (ix << 6) << 1) - 129]
				    ) / 2.;
			    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) 
				    - 129] * xrb[j - 1];
			    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) 
				    - 130] * zrb[j - 1];
			    errf_(&zbb[j - 1], &xbb[j - 1], &cbzb[j - 1], &
				    cbxb[j - 1]);
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130] = rkb[
				    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) *
				     cbzb[j - 1]) * d_sign(&c_b2366, &crkveb[
				    j - 1]);
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129] = rkb[
				    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) *
				     cbxb[j - 1]) * d_sign(&c_b2366, &cikveb[
				    j - 1]);
 
			}
		    } else if (beam_ .ibtyp == 1) {
			i__2 = tra1_ .napx;
			for (j = 1; j <= i__2; ++j) {
			    r2b[j - 1] = (beam_ .sigman2[(j + (ix << 6) << 1) 
				    - 129] - beam_ .sigman2[(j + (ix << 6) << 
				    1) - 130]) * 2.;
			    rb[j - 1] = sqrt(r2b[j - 1]);
			    rkb[j - 1] = track_ .strack[i__ - 1] * 
				    kons_ .pisqrt / rb[j - 1];
			    crkveb[j - 1] = ell_ .ed[ix - 1];
			    cikveb[j - 1] = ell_ .ek[ix - 1];
			    xrb[j - 1] = (d__1 = crkveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / 
				    rb[j - 1];
			    zrb[j - 1] = (d__1 = cikveb[j - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) / 
				    rb[j - 1];
			    tkb[j - 1] = (crkveb[j - 1] * crkveb[j - 1] / 
				    beam_ .sigman2[(j + (ix << 6) << 1) - 130]
				     + cikveb[j - 1] * cikveb[j - 1] / 
				    beam_ .sigman2[(j + (ix << 6) << 1) - 129]
				    ) / 2.;
			    xbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) 
				    - 129] * xrb[j - 1];
			    zbb[j - 1] = beam_ .sigmanq[(j + (ix << 6) << 1) 
				    - 130] * zrb[j - 1];
 
			}
			wzsubv_(& tra1_ .napx, zrb, xrb, crzb, crxb);
			wzsubv_(& tra1_ .napx, zbb, xbb, cbzb, cbxb);
			i__2 = tra1_ .napx;
			for (j = 1; j <= i__2; ++j) {
			    beam_ .beamoff[(j + (ix << 6) << 1) - 130] = rkb[
				    j - 1] * (crzb[j - 1] - exp(-tkb[j - 1]) *
				     cbzb[j - 1]) * d_sign(&c_b2366, &crkveb[
				    j - 1]);
			    beam_ .beamoff[(j + (ix << 6) << 1) - 129] = rkb[
				    j - 1] * (crxb[j - 1] - exp(-tkb[j - 1]) *
				     cbxb[j - 1]) * d_sign(&c_b2366, &cikveb[
				    j - 1]);
 
			}
		    }
		}
	    }
	    goto L290;
	}
	if (rand1_ .mout2 == 1 && rand1_ .icextal[i__ - 1] != 0) {
	    s_wsfe(&io___4465);
	    do_fio(&c__1, linopc_ .bez + (ix - 1 << 4), 16L);
	    do_fio(&c__1, (char *)& rand1_ .extalign[i__ - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& rand1_ .extalign[i__ + 19999], (ftnlen)
		    sizeof(doublereal));
	    do_fio(&c__1, (char *)& rand1_ .extalign[i__ + 39999], (ftnlen)
		    sizeof(doublereal));
	    e_wsfe();
	}
	if (kzz < 0) {
	    goto L180;
	}
	switch ((int)kzz) {
	    case 1:  goto L50;
	    case 2:  goto L60;
	    case 3:  goto L70;
	    case 4:  goto L80;
	    case 5:  goto L90;
	    case 6:  goto L100;
	    case 7:  goto L110;
	    case 8:  goto L120;
	    case 9:  goto L130;
	    case 10:  goto L140;
	    case 11:  goto L150;
	}
	track_ .ktrack[i__ - 1] = 31;
	goto L290;
L50:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 11;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e3;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L60:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 12;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1];
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L70:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 13;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * .001;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L80:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 14;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e-6;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L90:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 15;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e-9;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L100:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 16;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e-12;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L110:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 17;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e-15;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L120:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 18;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e-18;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L130:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 19;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e-21;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L140:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 20;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e-24;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L150:
	r0 = ell_ .ek[ix - 1];
	nmz = mult1_ .nmu[ix - 1];
	if ((( r0 ) >= 0 ? ( r0 ) : -( r0 ))  <= 1e-17 || nmz == 0) {
	    if ((d__1 = dkic_ .dki[ix - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17 && (d__2 = 
		    dkic_ .dki[ix + 699], (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) ) <= 1e-17) {
		track_ .ktrack[i__ - 1] = 31;
	    } else if ((d__1 = dkic_ .dki[ix - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17 && (
		    d__2 = dkic_ .dki[ix + 699], (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) ) <= 1e-17) {
		if ((d__1 = dkic_ .dki[ix + 1399], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		    track_ .ktrack[i__ - 1] = 33;
		    track_ .strack[i__ - 1] = dkic_ .dki[ix - 1] / dkic_ .dki[
			    ix + 1399];
		    track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tiltc[i__ - 1];
		    track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tilts[i__ - 1];
		} else {
		    track_ .ktrack[i__ - 1] = 35;
		    track_ .strack[i__ - 1] = dkic_ .dki[ix - 1];
		    track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tiltc[i__ - 1];
		    track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tilts[i__ - 1];
		}
	    } else if ((d__1 = dkic_ .dki[ix - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17 && (
		    d__2 = dkic_ .dki[ix + 699], (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) ) > 1e-17) {
		if ((d__1 = dkic_ .dki[ix + 1399], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		    track_ .ktrack[i__ - 1] = 37;
		    track_ .strack[i__ - 1] = dkic_ .dki[ix + 699] / 
			    dkic_ .dki[ix + 1399];
		    track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tiltc[i__ - 1];
		    track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tilts[i__ - 1];
		} else {
		    track_ .ktrack[i__ - 1] = 39;
		    track_ .strack[i__ - 1] = dkic_ .dki[ix + 699];
		    track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tiltc[i__ - 1];
		    track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tilts[i__ - 1];
		}
	    }
	} else {
	    if ((d__1 = dkic_ .dki[ix - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17 && (d__2 = 
		    dkic_ .dki[ix + 699], (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) ) <= 1e-17) {
		track_ .ktrack[i__ - 1] = 32;
	    } else if ((d__1 = dkic_ .dki[ix - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17 && (
		    d__2 = dkic_ .dki[ix + 699], (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) ) <= 1e-17) {
		if ((d__1 = dkic_ .dki[ix + 1399], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		    track_ .ktrack[i__ - 1] = 34;
		    track_ .strack[i__ - 1] = dkic_ .dki[ix - 1] / dkic_ .dki[
			    ix + 1399];
		    track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tiltc[i__ - 1];
		    track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tilts[i__ - 1];
		} else {
		    track_ .ktrack[i__ - 1] = 36;
		    track_ .strack[i__ - 1] = dkic_ .dki[ix - 1];
		    track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tiltc[i__ - 1];
		    track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tilts[i__ - 1];
		}
	    } else if ((d__1 = dkic_ .dki[ix - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17 && (
		    d__2 = dkic_ .dki[ix + 699], (( d__2 ) >= 0 ? ( d__2 ) : -( d__2 )) ) > 1e-17) {
		if ((d__1 = dkic_ .dki[ix + 1399], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		    track_ .ktrack[i__ - 1] = 38;
		    track_ .strack[i__ - 1] = dkic_ .dki[ix + 699] / 
			    dkic_ .dki[ix + 1399];
		    track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tiltc[i__ - 1];
		    track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tilts[i__ - 1];
		} else {
		    track_ .ktrack[i__ - 1] = 40;
		    track_ .strack[i__ - 1] = dkic_ .dki[ix + 699];
		    track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tiltc[i__ - 1];
		    track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * 
			    rand1_ .tilts[i__ - 1];
		}
	    }
	}
	if ((( r0 ) >= 0 ? ( r0 ) : -( r0 ))  <= 1e-17 || nmz == 0) {
	    goto L290;
	}
	if (rand1_ .mout2 == 1) {
	    benkcc = ell_ .ed[ix - 1] * mult1_ .benkc[mult1_ .irm[ix - 1] - 1]
		    ;
	    r0a = 1.;
	    r000 = r0 * mult1_ .r00[mult1_ .irm[ix - 1] - 1];
	    for (j = 1; j <= 11; ++j) {
		main3_ .fake[(j << 1) - 2] = main1_ .bbiv[j + (i__ + 1) * 11 
			- 23] * r0a / benkcc;
		main3_ .fake[(j << 1) - 1] = main1_ .aaiv[j + (i__ + 1) * 11 
			- 23] * r0a / benkcc;
 
		r0a *= r000;
	    }
	    s_wsfe(&io___4471);
	    do_fio(&c__1, linopc_ .bez + (ix - 1 << 4), 16L);
	    e_wsfe();
	    s_wsfe(&io___4472);
	    for (j = 1; j <= 3; ++j) {
		do_fio(&c__1, (char *)& main3_ .fake[(j << 1) - 2], (ftnlen)
			sizeof(doublereal));
	    }
	    e_wsfe();
	    s_wsfe(&io___4473);
	    for (j = 4; j <= 6; ++j) {
		do_fio(&c__1, (char *)& main3_ .fake[(j << 1) - 2], (ftnlen)
			sizeof(doublereal));
	    }
	    e_wsfe();
	    s_wsfe(&io___4474);
	    for (j = 7; j <= 9; ++j) {
		do_fio(&c__1, (char *)& main3_ .fake[(j << 1) - 2], (ftnlen)
			sizeof(doublereal));
	    }
	    e_wsfe();
	    s_wsfe(&io___4475);
	    for (j = 10; j <= 12; ++j) {
		do_fio(&c__1, (char *)& main3_ .fake[(j << 1) - 2], (ftnlen)
			sizeof(doublereal));
	    }
	    e_wsfe();
	    s_wsfe(&io___4476);
	    for (j = 13; j <= 15; ++j) {
		do_fio(&c__1, (char *)& main3_ .fake[(j << 1) - 2], (ftnlen)
			sizeof(doublereal));
	    }
	    e_wsfe();
	    s_wsfe(&io___4477);
	    for (j = 16; j <= 18; ++j) {
		do_fio(&c__1, (char *)& main3_ .fake[(j << 1) - 2], (ftnlen)
			sizeof(doublereal));
	    }
	    e_wsfe();
	    s_wsfe(&io___4478);
	    for (j = 19; j <= 20; ++j) {
		do_fio(&c__1, (char *)& main3_ .fake[(j << 1) - 2], (ftnlen)
			sizeof(doublereal));
	    }
	    e_wsfe();
	    s_wsfe(&io___4479);
	    for (j = 1; j <= 3; ++j) {
		do_fio(&c__1, (char *)& main3_ .fake[(j << 1) - 1], (ftnlen)
			sizeof(doublereal));
	    }
	    e_wsfe();
	    s_wsfe(&io___4480);
	    for (j = 4; j <= 6; ++j) {
		do_fio(&c__1, (char *)& main3_ .fake[(j << 1) - 1], (ftnlen)
			sizeof(doublereal));
	    }
	    e_wsfe();
	    s_wsfe(&io___4481);
	    for (j = 7; j <= 9; ++j) {
		do_fio(&c__1, (char *)& main3_ .fake[(j << 1) - 1], (ftnlen)
			sizeof(doublereal));
	    }
	    e_wsfe();
	    s_wsfe(&io___4482);
	    for (j = 10; j <= 12; ++j) {
		do_fio(&c__1, (char *)& main3_ .fake[(j << 1) - 1], (ftnlen)
			sizeof(doublereal));
	    }
	    e_wsfe();
	    s_wsfe(&io___4483);
	    for (j = 13; j <= 15; ++j) {
		do_fio(&c__1, (char *)& main3_ .fake[(j << 1) - 1], (ftnlen)
			sizeof(doublereal));
	    }
	    e_wsfe();
	    s_wsfe(&io___4484);
	    for (j = 16; j <= 18; ++j) {
		do_fio(&c__1, (char *)& main3_ .fake[(j << 1) - 1], (ftnlen)
			sizeof(doublereal));
	    }
	    e_wsfe();
	    s_wsfe(&io___4485);
	    for (j = 19; j <= 20; ++j) {
		do_fio(&c__1, (char *)& main3_ .fake[(j << 1) - 1], (ftnlen)
			sizeof(doublereal));
	    }
	    e_wsfe();
	    for (j = 1; j <= 20; ++j) {
		main3_ .fake[(j << 1) - 2] = 0.;
 
		main3_ .fake[(j << 1) - 1] = 0.;
	    }
	}
	goto L290;
L180:
	kzz = -kzz;
	switch ((int)kzz) {
	    case 1:  goto L190;
	    case 2:  goto L200;
	    case 3:  goto L210;
	    case 4:  goto L220;
	    case 5:  goto L230;
	    case 6:  goto L240;
	    case 7:  goto L250;
	    case 8:  goto L260;
	    case 9:  goto L270;
	    case 10:  goto L280;
	}
	track_ .ktrack[i__ - 1] = 31;
	goto L290;
L190:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 21;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e3;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L200:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 22;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1];
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L210:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 23;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * .001;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L220:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 24;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e-6;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L230:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 25;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e-9;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L240:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 26;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e-12;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L250:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 27;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e-15;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L260:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 28;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e-18;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L270:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 29;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e-21;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
	goto L290;
L280:
	if ((d__1 = main1_ .smiv[i__ - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) <= 1e-17) {
	    track_ .ktrack[i__ - 1] = 31;
	    goto L290;
	}
	track_ .ktrack[i__ - 1] = 30;
	track_ .strack[i__ - 1] = main1_ .smiv[i__ - 1] * 1e-24;
	track_ .strackc[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tiltc[
		i__ - 1];
	track_ .stracks[i__ - 1] = track_ .strack[i__ - 1] * rand1_ .tilts[
		i__ - 1];
L290:
	;
    }
    i__1 = tra1_ .napx;
    for (j = 1; j <= i__1; ++j) {
	track_ .dpsv1[j - 1] = main1_ .dpsv[j - 1] * 1e3 / (main1_ .dpsv[j - 
		1] + 1.);
 
    }
    track_ .nwri = tra1_ .nwr[2];
    if (track_ .nwri == 0) {
	track_ .nwri = tra1_ .numl + tra1_ .numlr + 1;
    }
    if (syn_ .idp == 0 || syn_ .ition == 0) {
	thin4d_(nthinerr);
    } else {
	syn_ .hsy[2] = syn_ .hsy[2] * .001 * syn_ .ition;
	for (jj = 1; jj <= 700; ++jj) {
	    if (ell_ .kz[jj - 1] == 12) {
		syn_ .hsyc[jj - 1] = syn_ .hsyc[jj - 1] * .001 * syn_ .itionc[
			jj - 1];
	    }
 
	}
	if ((( syn_ .phas ) >= 0 ? ( syn_ .phas ) : -( syn_ .phas ))  >= 1e-17) {
	    thin6dua_(nthinerr);
	} else {
	    thin6d_(nthinerr);
	}
    }
    return 0;
}  

 
  int trx6_(h__, rh, vtr)
integer *h__, *rh, *vtr;
{
    extern   int daall_(), dacct_();

 



     
    --vtr;

     
    daall_(h__, &c__1, "H         ", & ii_ .no, & ii_ .nv, 10L);
    daall_(rh, &c__1, "RH        ", & ii_ .no, & ii_ .nv, 10L);
    daall_(&vtr[1], &c__12, "VTR       ", & ii_ .no, & ii_ .nv, 10L);
 
    dacct_(h__, &c__1, &vtr[1], & ii_ .nv, rh, &c__1);
    return 0;
}  

doublereal tuer6_(j)
integer *j;
{
     
    doublereal ret_val;

     
    static integer i__, jj[3];

     
    --j;

     
    ret_val = 0.;
    for (i__ = 1; i__ <= 3; ++i__) {
 
	jj[i__ - 1] = j[(i__ << 1) - 1] - j[i__ * 2];
    }
    ret_val = tune_ .tue[jj[0] + (jj[1] + jj[2] * 41) * 41 + 34460];
    return ret_val;
}  

 
 

 
 
  int umlauf_(dpp, ium, ierr)
doublereal *dpp;
integer *ium, *ierr;
{
     
    static char fmt_10010[] = "(\002 \002/131(\002-\002))";
    static char fmt_10000[] = "(10x,\002AMPLITUDES EXCEED THE MAXIMUM VALUES IN UMLAUF\002/)";

     
    integer i__1, i__2;
    doublereal d__1;

     
    integer s_wsfe(), e_wsfe();

     
    static integer i__, j, k, l, l1;
    static doublereal r0, aa[11], bb[11], ci[11], cr[11];
    static integer ix, kx;
    static doublereal qu, qv, xl, zl, xs;
    static integer im;
    static doublereal zs, r0a, qu1, dpr[5];
    static integer izu;
    static doublereal puf, dyy1, dyy2;
    static integer kpz, kzz;
    static doublereal ekk;
    static integer nmz;
    static doublereal dyy11, cikve, benkr, crkve, tiltck, tiltsk, crkveuk;

     
    static cilist io___4608 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___4609 = { 0, 6, 0, fmt_10000, 0 };


 

 
 

 

    for (i__ = 1; i__ <= 11; ++i__) {
	aa[i__ - 1] = 0.;
	bb[i__ - 1] = 0.;
	cr[i__ - 1] = 0.;
	ci[i__ - 1] = 0.;
 
    }
    for (i__ = 1; i__ <= 5; ++i__) {
	dpr[i__ - 1] = 0.;
 
    }
    *ierr = 0;
    dpr[0] = *dpp * 1e3;
    izu = 0;
    i__1 = str_ .iu;
    for (k = 1; k <= i__1; ++k) {
	ix = str_ .ic[k - 1];
	if (ix > 300) {
	    goto L60;
	}
	if (ix <= 0) {
	    goto L40;
	}
	i__2 = *ium;
	for (j = 1; j <= i__2; ++j) {
	    for (kx = 1; kx <= 2; ++kx) {
		if (tit_ .ithick == 1) {
		    puf = (tra_._1) .x[j + kx * 6 - 7];
		    (tra_._1) .x[j + kx * 6 - 7] = mat_ .bl1[ix + (kx + 2) * 300 - 
			    901] * puf + mat_ .bl1[ix + (kx + 4) * 300 - 901] 
			    * (tra_._1) .y[j + kx * 6 - 7] + dpr[j - 1] * 
			    mat_ .bl1[ix + (kx + 10) * 300 - 901];
		    (tra_._1) .y[j + kx * 6 - 7] = mat_ .bl1[ix + (kx + 6) * 300 - 
			    901] * puf + mat_ .bl1[ix + (kx + 8) * 300 - 901] 
			    * (tra_._1) .y[j + kx * 6 - 7] + dpr[j - 1] * 
			    mat_ .bl1[ix + (kx + 12) * 300 - 901];
		} else {
		    (tra_._1) .x[j + kx * 6 - 7] += mat_ .bl1[ix + (kx + 4) * 300 
			    - 901] * (tra_._1) .y[j + kx * 6 - 7];
		}
 
	    }
	}
	goto L350;
L40:
	ix = -ix;
	i__2 = *ium;
	for (j = 1; j <= i__2; ++j) {
	    for (kx = 1; kx <= 2; ++kx) {
		if (tit_ .ithick == 1) {
		    puf = (tra_._1) .x[j + kx * 6 - 7];
		    (tra_._1) .x[j + kx * 6 - 7] = mat_ .bl2[ix + (kx + 2) * 300 - 
			    901] * puf + mat_ .bl2[ix + (kx + 4) * 300 - 901] 
			    * (tra_._1) .y[j + kx * 6 - 7] + dpr[j - 1] * 
			    mat_ .bl2[ix + (kx + 10) * 300 - 901];
		    (tra_._1) .y[j + kx * 6 - 7] = mat_ .bl2[ix + (kx + 6) * 300 - 
			    901] * puf + mat_ .bl2[ix + (kx + 8) * 300 - 901] 
			    * (tra_._1) .y[j + kx * 6 - 7] + dpr[j - 1] * 
			    mat_ .bl2[ix + (kx + 12) * 300 - 901];
		} else {
		    (tra_._1) .x[j + kx * 6 - 7] += mat_ .bl2[ix + (kx + 4) * 300 
			    - 901] * (tra_._1) .y[j + kx * 6 - 7];
		}
 
	    }
	}
	goto L350;
L60:
	ix += -300;
	qu = 0.;
	qv = 0.;
	dyy1 = 0.;
	dyy2 = 0.;
	kpz = ell_ .kp[ix - 1];
	if (kpz == 6) {
	    goto L350;
	}
	kzz = ell_ .kz[ix - 1];
	if ((( (tra_._1) .x[0] ) >= 0 ? ( (tra_._1) .x[0] ) : -( (tra_._1) .x[0] ))  < 1e4 && (( (tra_._1) .x[6] ) >= 0 ? ( (tra_._1) .x[6] ) : -( (tra_._1) .x[6] ))  < 1e4) {
	    goto L70;
	}
	*ierr = 1;
	s_wsfe(&io___4608);
	e_wsfe();
	s_wsfe(&io___4609);
	e_wsfe();
	return 0;
L70:
	if (kzz == 0) {
	    goto L350;
	}
	if (rand0_ .iorg < 0) {
	    rand0_ .mzu[k - 1] = izu;
	}
	izu = rand0_ .mzu[k - 1] + 1;
	ekk = (ell_ .sm[ix - 1] + rand0_ .zfz[izu - 1] * ell_ .ek[ix - 1]) / (
		*dpp + 1.);
	++izu;
	xs = pla_ .xpl[ix - 1] + rand0_ .zfz[izu - 1] * pla_ .xrms[ix - 1];
	++izu;
	zs = pla_ .zpl[ix - 1] + rand0_ .zfz[izu - 1] * pla_ .zrms[ix - 1];
	xl = ((tra_._1) .x[0] - xs) * rand1_ .tiltc[k - 1] + ((tra_._1) .x[6] - zs) * 
		rand1_ .tilts[k - 1];
	zl = -((tra_._1) .x[0] - xs) * rand1_ .tilts[k - 1] + ((tra_._1) .x[6] - zs) * 
		rand1_ .tiltc[k - 1];
	crkve = xl;
	cikve = zl;
	if (kzz < 0) {
	    goto L220;
	}
	switch ((int)kzz) {
	    case 1:  goto L80;
	    case 2:  goto L90;
	    case 3:  goto L100;
	    case 4:  goto L110;
	    case 5:  goto L120;
	    case 6:  goto L130;
	    case 7:  goto L140;
	    case 8:  goto L150;
	    case 9:  goto L160;
	    case 10:  goto L170;
	    case 11:  goto L180;
	}
	goto L350;
 
L80:
	ekk *= 1e3;
	(tra_._1) .y[0] += ekk * rand1_ .tiltc[k - 1];
	(tra_._1) .y[6] += ekk * rand1_ .tilts[k - 1];
	goto L350;
 
L90:
	dyy1 = ekk * crkve;
	dyy2 = -ekk * cikve;
	(tra_._1) .y[0] = (tra_._1) .y[0] + rand1_ .tiltc[k - 1] * dyy1 - rand1_ .tilts[
		k - 1] * dyy2;
	(tra_._1) .y[6] = (tra_._1) .y[6] + rand1_ .tiltc[k - 1] * dyy2 + rand1_ .tilts[
		k - 1] * dyy1;
	if (*ium == 1) {
	    goto L350;
	}
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = ekk * tiltck;
	qv = -ekk * tiltsk;
	goto L330;
 
L100:
	ekk *= .001;
	if (*ium != 1) {
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    qu = ekk * 2. * (tiltck * crkve + tiltsk * cikve);
	    qv = ekk * 2. * (tiltck * cikve - tiltsk * crkve);
	}
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * crkve;
	dyy2 = -ekk * cikve;
	(tra_._1) .y[0] = (tra_._1) .y[0] + rand1_ .tiltc[k - 1] * dyy1 - rand1_ .tilts[
		k - 1] * dyy2;
	(tra_._1) .y[6] = (tra_._1) .y[6] + rand1_ .tiltc[k - 1] * dyy2 + rand1_ .tilts[
		k - 1] * dyy1;
	if (*ium == 1) {
	    goto L350;
	}
	goto L330;
 
L110:
	ekk *= 1e-6;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	if (*ium != 1) {
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    qu = ekk * 3. * (tiltck * crkve + tiltsk * cikve);
	    qv = ekk * 3. * (tiltck * cikve - tiltsk * crkve);
	}
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * crkve;
	dyy2 = -ekk * cikve;
	(tra_._1) .y[0] = (tra_._1) .y[0] + rand1_ .tiltc[k - 1] * dyy1 - rand1_ .tilts[
		k - 1] * dyy2;
	(tra_._1) .y[6] = (tra_._1) .y[6] + rand1_ .tiltc[k - 1] * dyy2 + rand1_ .tilts[
		k - 1] * dyy1;
	if (*ium == 1) {
	    goto L350;
	}
	goto L330;
 
L120:
	ekk *= 1e-9;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	if (*ium != 1) {
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    qu = ekk * 4. * (tiltck * crkve + tiltsk * cikve);
	    qv = ekk * 4. * (tiltck * cikve - tiltsk * crkve);
	}
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * crkve;
	dyy2 = -ekk * cikve;
	(tra_._1) .y[0] = (tra_._1) .y[0] + rand1_ .tiltc[k - 1] * dyy1 - rand1_ .tilts[
		k - 1] * dyy2;
	(tra_._1) .y[6] = (tra_._1) .y[6] + rand1_ .tiltc[k - 1] * dyy2 + rand1_ .tilts[
		k - 1] * dyy1;
	if (*ium == 1) {
	    goto L350;
	}
	goto L330;
 
L130:
	ekk *= 1e-12;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	if (*ium != 1) {
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    qu = ekk * 5 * (tiltck * crkve + tiltsk * cikve);
	    qv = ekk * 5 * (tiltck * cikve - tiltsk * crkve);
	}
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * crkve;
	dyy2 = -ekk * cikve;
	(tra_._1) .y[0] = (tra_._1) .y[0] + rand1_ .tiltc[k - 1] * dyy1 - rand1_ .tilts[
		k - 1] * dyy2;
	(tra_._1) .y[6] = (tra_._1) .y[6] + rand1_ .tiltc[k - 1] * dyy2 + rand1_ .tilts[
		k - 1] * dyy1;
	if (*ium == 1) {
	    goto L350;
	}
	goto L330;
 
L140:
	ekk *= 1e-15;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	if (*ium != 1) {
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    qu = ekk * 6 * (tiltck * crkve + tiltsk * cikve);
	    qv = ekk * 6 * (tiltck * cikve - tiltsk * crkve);
	}
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * crkve;
	dyy2 = -ekk * cikve;
	(tra_._1) .y[0] = (tra_._1) .y[0] + rand1_ .tiltc[k - 1] * dyy1 - rand1_ .tilts[
		k - 1] * dyy2;
	(tra_._1) .y[6] = (tra_._1) .y[6] + rand1_ .tiltc[k - 1] * dyy2 + rand1_ .tilts[
		k - 1] * dyy1;
	if (*ium == 1) {
	    goto L350;
	}
	goto L330;
 
L150:
	ekk *= 1e-18;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	if (*ium != 1) {
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    qu = ekk * 7 * (tiltck * crkve + tiltsk * cikve);
	    qv = ekk * 7 * (tiltck * cikve - tiltsk * crkve);
	}
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * crkve;
	dyy2 = -ekk * cikve;
	(tra_._1) .y[0] = (tra_._1) .y[0] + rand1_ .tiltc[k - 1] * dyy1 - rand1_ .tilts[
		k - 1] * dyy2;
	(tra_._1) .y[6] = (tra_._1) .y[6] + rand1_ .tiltc[k - 1] * dyy2 + rand1_ .tilts[
		k - 1] * dyy1;
	if (*ium == 1) {
	    goto L350;
	}
	goto L330;
 
L160:
	ekk *= 1e-21;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	if (*ium != 1) {
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    qu = ekk * 8 * (tiltck * crkve + tiltsk * cikve);
	    qv = ekk * 8 * (tiltck * cikve - tiltsk * crkve);
	}
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * crkve;
	dyy2 = -ekk * cikve;
	(tra_._1) .y[0] = (tra_._1) .y[0] + rand1_ .tiltc[k - 1] * dyy1 - rand1_ .tilts[
		k - 1] * dyy2;
	(tra_._1) .y[6] = (tra_._1) .y[6] + rand1_ .tiltc[k - 1] * dyy2 + rand1_ .tilts[
		k - 1] * dyy1;
	if (*ium == 1) {
	    goto L350;
	}
	goto L330;
 
L170:
	ekk *= 1e-24;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	if (*ium != 1) {
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    qu = ekk * 9 * (tiltck * crkve + tiltsk * cikve);
	    qv = ekk * 9 * (tiltck * cikve - tiltsk * crkve);
	}
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * crkve;
	dyy2 = -ekk * cikve;
	(tra_._1) .y[0] = (tra_._1) .y[0] + rand1_ .tiltc[k - 1] * dyy1 - rand1_ .tilts[
		k - 1] * dyy2;
	(tra_._1) .y[6] = (tra_._1) .y[6] + rand1_ .tiltc[k - 1] * dyy2 + rand1_ .tilts[
		k - 1] * dyy1;
	if (*ium == 1) {
	    goto L350;
	}
	goto L330;
L180:
	r0 = ell_ .ek[ix - 1];
	if ((d__1 = dkic_ .dki[ix - 1], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
	    if ((d__1 = dkic_ .dki[ix + 1399], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		qu = - dkic_ .dki[ix - 1] / dkic_ .dki[ix + 1399] * dkic_ .dki[
			ix - 1] / (*dpp + 1.);
		(tra_._1) .y[0] = (tra_._1) .y[0] + (qu * xl - *dpp * 1e3 * dkic_ .dki[
			ix - 1] / (*dpp + 1.)) * rand1_ .tiltc[k - 1] + 
			dkic_ .dki[ix - 1] * 1e3 / (*dpp + 1.) * (1. - 
			rand1_ .tiltc[k - 1]);
		(tra_._1) .y[6] = (tra_._1) .y[6] + (qu * xl - *dpp * 1e3 * dkic_ .dki[
			ix - 1] / (*dpp + 1.)) * rand1_ .tilts[k - 1] + 
			dkic_ .dki[ix - 1] * 1e3 / (*dpp + 1.) * 
			rand1_ .tilts[k - 1];
		i__2 = *ium;
		for (j = 2; j <= i__2; ++j) {
		    (tra_._1) .y[j - 1] += qu * (tra_._1) .x[j - 1] * rand1_ .tiltc[k - 
			    1];
		    (tra_._1) .y[j + 5] += qu * (tra_._1) .x[j + 5] * rand1_ .tilts[k - 
			    1];
 
		}
	    } else {
		(tra_._1) .y[0] = (tra_._1) .y[0] - dkic_ .dki[ix - 1] * *dpp / (*dpp + 
			1.) * 1e3 * rand1_ .tiltc[k - 1] + dkic_ .dki[ix - 1] 
			* 1e3 / (*dpp + 1.) * (1. - rand1_ .tiltc[k - 1]);
		(tra_._1) .y[6] = (tra_._1) .y[6] - dkic_ .dki[ix - 1] * *dpp / (*dpp + 
			1.) * 1e3 * rand1_ .tilts[k - 1] + dkic_ .dki[ix - 1] 
			* 1e3 / (*dpp + 1.) * rand1_ .tilts[k - 1];
	    }
	}
	if ((d__1 = dkic_ .dki[ix + 699], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
	    if ((d__1 = dkic_ .dki[ix + 1399], (( d__1 ) >= 0 ? ( d__1 ) : -( d__1 )) ) > 1e-17) {
		qu = dkic_ .dki[ix + 699] / dkic_ .dki[ix + 1399] * 
			dkic_ .dki[ix + 699] / (*dpp + 1.);
		(tra_._1) .y[0] = (tra_._1) .y[0] + (qu * zl - *dpp * 1e3 * dkic_ .dki[
			ix + 699] / (*dpp + 1.)) * rand1_ .tilts[k - 1] + 
			dkic_ .dki[ix + 699] * 1e3 / (*dpp + 1.) * 
			rand1_ .tilts[k - 1];
		(tra_._1) .y[6] = (tra_._1) .y[6] + (-qu * zl + *dpp * 1e3 * dkic_ .dki[
			ix + 699] / (*dpp + 1.)) * rand1_ .tiltc[k - 1] - 
			dkic_ .dki[ix + 699] * 1e3 / (*dpp + 1.) * (1. - 
			rand1_ .tiltc[k - 1]);
		i__2 = *ium;
		for (j = 2; j <= i__2; ++j) {
		    (tra_._1) .y[j - 1] += qu * (tra_._1) .x[j - 1] * rand1_ .tilts[k - 
			    1];
		    (tra_._1) .y[j + 5] -= qu * (tra_._1) .x[j + 5] * rand1_ .tiltc[k - 
			    1];
 
		}
	    } else {
		(tra_._1) .y[0] = (tra_._1) .y[0] - dkic_ .dki[ix + 699] * *dpp / (*dpp 
			+ 1.) * 1e3 * rand1_ .tilts[k - 1] + dkic_ .dki[ix + 
			699] / (*dpp + 1.) * 1e3 * rand1_ .tilts[k - 1];
		(tra_._1) .y[6] = (tra_._1) .y[6] + dkic_ .dki[ix + 699] * *dpp / (*dpp 
			+ 1.) * 1e3 * rand1_ .tiltc[k - 1] - dkic_ .dki[ix + 
			699] / (*dpp + 1.) * 1e3 * (1. - rand1_ .tiltc[k - 1])
			;
	    }
	}
	if ((( r0 ) >= 0 ? ( r0 ) : -( r0 ))  <= 1e-17) {
	    goto L350;
	}
	nmz = mult1_ .nmu[ix - 1];
	if (nmz == 0) {
	    izu += 22;
	    goto L350;
	}
	im = mult1_ .irm[ix - 1];
	r0a = 1.;
	benkr = ell_ .ed[ix - 1] / (*dpp + 1.);
	i__2 = nmz;
	for (l = 1; l <= i__2; ++l) {
	    ++izu;
	    aa[l - 1] = multi_ .ak0[im + l * 700 - 701] + rand0_ .zfz[izu - 1]
		     * multi_ .aka[im + l * 700 - 701];
	    aa[l - 1] = benkr * aa[l - 1] / r0a;
	    ++izu;
	    bb[l - 1] = multi_ .bk0[im + l * 700 - 701] + rand0_ .zfz[izu - 1]
		     * multi_ .bka[im + l * 700 - 701];
	    bb[l - 1] = benkr * bb[l - 1] / r0a;
	    r0a *= r0;
 
	}
	if (nmz >= 2) {
	    qu = bb[1];
	    qv = -aa[1];
	    dyy1 = bb[0] + bb[1] * crkve + aa[1] * cikve;
	    dyy2 = aa[0] - bb[1] * cikve + aa[1] * crkve;
	    i__2 = nmz;
	    for (l = 3; l <= i__2; ++l) {
		l1 = l - 1;
		qu += l1 * (bb[l - 1] * crkve + aa[l - 1] * cikve);
		qv += l1 * (bb[l - 1] * cikve - aa[l - 1] * crkve);
		crkveuk = crkve * xl - cikve * zl;
		cikve = crkve * zl + cikve * xl;
		crkve = crkveuk;
		dyy1 = dyy1 + bb[l - 1] * crkve + aa[l - 1] * cikve;
		dyy2 = dyy2 - bb[l - 1] * cikve + aa[l - 1] * crkve;
 
	    }
	} else {
	    qu = 0.;
	    qv = 0.;
	    dyy1 = bb[0];
	    dyy2 = aa[0];
	}
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu1 = tiltck * qu - tiltsk * qv;
	qv = tiltck * qv + tiltsk * qu;
	qu = qu1;
	dyy11 = rand1_ .tiltc[k - 1] * dyy1 - rand1_ .tilts[k - 1] * dyy2;
	dyy2 = rand1_ .tiltc[k - 1] * dyy2 + rand1_ .tilts[k - 1] * dyy1;
	dyy1 = dyy11;
	izu = izu + 22 - (nmz << 1);
	(tra_._1) .y[0] += dyy1;
	(tra_._1) .y[6] += dyy2;
	if (*ium == 1) {
	    goto L350;
	}
	goto L330;
 
L220:
	kzz = -kzz;
	switch ((int)kzz) {
	    case 1:  goto L230;
	    case 2:  goto L240;
	    case 3:  goto L250;
	    case 4:  goto L260;
	    case 5:  goto L270;
	    case 6:  goto L280;
	    case 7:  goto L290;
	    case 8:  goto L300;
	    case 9:  goto L310;
	    case 10:  goto L320;
	}
	goto L350;
 
L230:
	ekk *= 1e3;
	(tra_._1) .y[0] -= ekk * rand1_ .tilts[k - 1];
	(tra_._1) .y[6] += ekk * rand1_ .tiltc[k - 1];
	goto L350;
 
L240:
	dyy1 = ekk * cikve;
	dyy2 = ekk * crkve;
	(tra_._1) .y[0] = (tra_._1) .y[0] + rand1_ .tiltc[k - 1] * dyy1 - rand1_ .tilts[
		k - 1] * dyy2;
	(tra_._1) .y[6] = (tra_._1) .y[6] + rand1_ .tiltc[k - 1] * dyy2 + rand1_ .tilts[
		k - 1] * dyy1;
	if (*ium == 1) {
	    goto L350;
	}
	tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - rand1_ .tilts[
		k - 1] * rand1_ .tilts[k - 1];
	tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	qu = -ekk * tiltsk;
	qv = -ekk * tiltck;
	goto L330;
 
L250:
	ekk *= .001;
	if (*ium != 1) {
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    qu = ekk * 2. * (tiltck * cikve - tiltsk * crkve);
	    qv = -ekk * 2. * (tiltck * crkve + tiltsk * cikve);
	}
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * cikve;
	dyy2 = ekk * crkve;
	(tra_._1) .y[0] = (tra_._1) .y[0] + rand1_ .tiltc[k - 1] * dyy1 - rand1_ .tilts[
		k - 1] * dyy2;
	(tra_._1) .y[6] = (tra_._1) .y[6] + rand1_ .tiltc[k - 1] * dyy2 + rand1_ .tilts[
		k - 1] * dyy1;
	if (*ium == 1) {
	    goto L350;
	}
	goto L330;
 
L260:
	ekk *= 1e-6;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	if (*ium != 1) {
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    qu = ekk * 3. * (tiltck * cikve - tiltsk * crkve);
	    qv = ekk * -3. * (tiltck * crkve + tiltsk * cikve);
	}
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * cikve;
	dyy2 = ekk * crkve;
	(tra_._1) .y[0] = (tra_._1) .y[0] + rand1_ .tiltc[k - 1] * dyy1 - rand1_ .tilts[
		k - 1] * dyy2;
	(tra_._1) .y[6] = (tra_._1) .y[6] + rand1_ .tiltc[k - 1] * dyy2 + rand1_ .tilts[
		k - 1] * dyy1;
	if (*ium == 1) {
	    goto L350;
	}
	goto L330;
 
L270:
	ekk *= 1e-9;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	if (*ium != 1) {
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    qu = ekk * 4. * (tiltck * cikve - tiltsk * crkve);
	    qv = ekk * -4. * (tiltck * crkve + tiltsk * cikve);
	}
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * cikve;
	dyy2 = ekk * crkve;
	(tra_._1) .y[0] = (tra_._1) .y[0] + rand1_ .tiltc[k - 1] * dyy1 - rand1_ .tilts[
		k - 1] * dyy2;
	(tra_._1) .y[6] = (tra_._1) .y[6] + rand1_ .tiltc[k - 1] * dyy2 + rand1_ .tilts[
		k - 1] * dyy1;
	if (*ium == 1) {
	    goto L350;
	}
	goto L330;
 
L280:
	ekk *= 1e-12;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	if (*ium != 1) {
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    qu = ekk * 5 * (tiltck * cikve - tiltsk * crkve);
	    qv = ekk * -5 * (tiltck * crkve + tiltsk * cikve);
	}
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * cikve;
	dyy2 = ekk * crkve;
	(tra_._1) .y[0] = (tra_._1) .y[0] + rand1_ .tiltc[k - 1] * dyy1 - rand1_ .tilts[
		k - 1] * dyy2;
	(tra_._1) .y[6] = (tra_._1) .y[6] + rand1_ .tiltc[k - 1] * dyy2 + rand1_ .tilts[
		k - 1] * dyy1;
	if (*ium == 1) {
	    goto L350;
	}
	goto L330;
 
L290:
	ekk *= 1e-15;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	if (*ium != 1) {
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    qu = ekk * 6 * (tiltck * cikve - tiltsk * crkve);
	    qv = ekk * -6 * (tiltck * crkve + tiltsk * cikve);
	}
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * cikve;
	dyy2 = ekk * crkve;
	(tra_._1) .y[0] = (tra_._1) .y[0] + rand1_ .tiltc[k - 1] * dyy1 - rand1_ .tilts[
		k - 1] * dyy2;
	(tra_._1) .y[6] = (tra_._1) .y[6] + rand1_ .tiltc[k - 1] * dyy2 + rand1_ .tilts[
		k - 1] * dyy1;
	if (*ium == 1) {
	    goto L350;
	}
	goto L330;
 
L300:
	ekk *= 1e-18;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	if (*ium != 1) {
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    qu = ekk * 7 * (tiltck * cikve - tiltsk * crkve);
	    qv = ekk * -7 * (tiltck * crkve + tiltsk * cikve);
	}
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * cikve;
	dyy2 = ekk * crkve;
	(tra_._1) .y[0] = (tra_._1) .y[0] + rand1_ .tiltc[k - 1] * dyy1 - rand1_ .tilts[
		k - 1] * dyy2;
	(tra_._1) .y[6] = (tra_._1) .y[6] + rand1_ .tiltc[k - 1] * dyy2 + rand1_ .tilts[
		k - 1] * dyy1;
	if (*ium == 1) {
	    goto L350;
	}
	goto L330;
 
L310:
	ekk *= 1e-21;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	if (*ium != 1) {
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    qu = ekk * 8 * (tiltck * cikve - tiltsk * crkve);
	    qv = ekk * -8 * (tiltck * crkve + tiltsk * cikve);
	}
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * cikve;
	dyy2 = ekk * crkve;
	(tra_._1) .y[0] = (tra_._1) .y[0] + rand1_ .tiltc[k - 1] * dyy1 - rand1_ .tilts[
		k - 1] * dyy2;
	(tra_._1) .y[6] = (tra_._1) .y[6] + rand1_ .tiltc[k - 1] * dyy2 + rand1_ .tilts[
		k - 1] * dyy1;
	if (*ium == 1) {
	    goto L350;
	}
	goto L330;
 
L320:
	ekk *= 1e-24;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	if (*ium != 1) {
	    tiltck = rand1_ .tiltc[k - 1] * rand1_ .tiltc[k - 1] - 
		    rand1_ .tilts[k - 1] * rand1_ .tilts[k - 1];
	    tiltsk = rand1_ .tiltc[k - 1] * 2. * rand1_ .tilts[k - 1];
	    qu = ekk * 9 * (tiltck * cikve - tiltsk * crkve);
	    qv = ekk * -9 * (tiltck * crkve + tiltsk * cikve);
	}
	crkveuk = crkve * xl - cikve * zl;
	cikve = crkve * zl + cikve * xl;
	crkve = crkveuk;
	dyy1 = ekk * cikve;
	dyy2 = ekk * crkve;
	(tra_._1) .y[0] = (tra_._1) .y[0] + rand1_ .tiltc[k - 1] * dyy1 - rand1_ .tilts[
		k - 1] * dyy2;
	(tra_._1) .y[6] = (tra_._1) .y[6] + rand1_ .tiltc[k - 1] * dyy2 + rand1_ .tilts[
		k - 1] * dyy1;
	if (*ium == 1) {
	    goto L350;
	}
L330:
	i__2 = *ium;
	for (j = 2; j <= i__2; ++j) {
	    (tra_._1) .y[j - 1] = (tra_._1) .y[j - 1] + (tra_._1) .x[j - 1] * qu - qv * 
		    (tra_._1) .x[j + 5];
	    (tra_._1) .y[j + 5] = (tra_._1) .y[j + 5] - (tra_._1) .x[j + 5] * qu - qv * 
		    (tra_._1) .x[j - 1];
 
	}
L350:
	;
    }
 

    return 0;
}  

 
 
  int write4_()
{
 

 
 
}  

 
 
  int write6_(n)
integer *n;
{
     
    static char fmt_10000[] = "(1x/5x,\002PARTICLE \002,i3,\002 RANDOM SEED \002,i8,\002 MOMENTUM DEVIATION \002,g12.5/5x,\002REVOLUTION \002,i8/)";
    static char fmt_10010[] = "(10x,f47.33)";

     
    integer i__1, i__2;

     
    integer s_wsfe(), do_fio(), e_wsfe(), s_wsle(), do_lio(), e_wsle();

     
    static integer ia, id, ig, ie, ia2;
    extern   int flush_();

     
    static cilist io___4633 = { 0, 6, 0, fmt_10000, 0 };
    static cilist io___4635 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___4636 = { 1, 12, 0, fmt_10010, 0 };
    static cilist io___4637 = { 1, 12, 0, fmt_10010, 0 };
    static cilist io___4638 = { 1, 12, 0, fmt_10010, 0 };
    static cilist io___4639 = { 1, 12, 0, fmt_10010, 0 };
    static cilist io___4640 = { 0, 6, 0, 0, 0 };


 


 
 

 
 

    id = 0;
    i__1 = tra1_ .napxo;
    for (ia = 1; ia <= i__1; ia += 2) {
	ig = ia + 1;
	ia2 = ig / 2;
	i__2 = 91 - ia2;
	flush_(&i__2);
 
	if (! main1_ .pstop[ia - 1] && ! main1_ .pstop[ig - 1]) {
	    s_wsfe(&io___4633);
	    do_fio(&c__1, (char *)&ia, (ftnlen)sizeof(integer));
	    i__2 = main1_ .nms[ia - 1] * rand0_ .izu0;
	    do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
	    do_fio(&c__1, (char *)& main1_ .dp0v[ia - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
	    e_wsfe();
	    ++id;
	    ie = id + 1;
	    s_wsfe(&io___4635);
	    do_fio(&c__1, (char *)& main1_ .xv[(id << 1) - 2], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .yv[(id << 1) - 2], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .xv[(id << 1) - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .yv[(id << 1) - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .sigmv[id - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .dpsv[id - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .xv[(ie << 1) - 2], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .yv[(ie << 1) - 2], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .xv[(ie << 1) - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .yv[(ie << 1) - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .sigmv[ie - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .dpsv[ie - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& syn_ .e0, (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)& main1_ .ejv[id - 1], (ftnlen)sizeof(
		    doublereal));
	    do_fio(&c__1, (char *)& main1_ .ejv[ie - 1], (ftnlen)sizeof(
		    doublereal));
	    e_wsfe();
	    erro_ .ierro = s_wsfe(&io___4636);
	    if (erro_ .ierro != 0) {
		goto L100131;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .xv[(id << 1) - 2], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100131;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .yv[(id << 1) - 2], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100131;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .xv[(id << 1) - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100131;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .yv[(id << 1) - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100131;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .sigmv[id - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100131;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .dpsv[id - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100131;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .xv[(ie << 1) - 2], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100131;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .yv[(ie << 1) - 2], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100131;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .xv[(ie << 1) - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100131;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .yv[(ie << 1) - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100131;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .sigmv[ie - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100131;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .dpsv[ie - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100131;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& syn_ .e0, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100131;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .ejv[id - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100131;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .ejv[ie - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100131;
	    }
	    erro_ .ierro = e_wsfe();
L100131:
	    ++id;
 
	} else if (main1_ .pstop[ia - 1] && ! main1_ .pstop[ig - 1]) {
	    ++id;
	    erro_ .ierro = s_wsfe(&io___4637);
	    if (erro_ .ierro != 0) {
		goto L100132;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .xvl[(ia << 1) - 2], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100132;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .yvl[(ia << 1) - 2], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100132;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .xvl[(ia << 1) - 1], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100132;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .yvl[(ia << 1) - 1], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100132;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .sigmvl[ia - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100132;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .dpsvl[ia - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100132;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .xv[(id << 1) - 2], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100132;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .yv[(id << 1) - 2], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100132;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .xv[(id << 1) - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100132;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .yv[(id << 1) - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100132;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .sigmv[id - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100132;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .dpsv[id - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100132;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& syn_ .e0, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100132;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .ejvl[ia - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100132;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .ejv[id - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100132;
	    }
	    erro_ .ierro = e_wsfe();
L100132:
 
	    ;
	} else if (! main1_ .pstop[ia - 1] && main1_ .pstop[ig - 1]) {
	    ++id;
	    erro_ .ierro = s_wsfe(&io___4638);
	    if (erro_ .ierro != 0) {
		goto L100133;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .xv[(id << 1) - 2], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100133;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .yv[(id << 1) - 2], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100133;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .xv[(id << 1) - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100133;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .yv[(id << 1) - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100133;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .sigmv[id - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100133;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .dpsv[id - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100133;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .xvl[(ig << 1) - 2], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100133;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .yvl[(ig << 1) - 2], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100133;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .xvl[(ig << 1) - 1], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100133;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .yvl[(ig << 1) - 1], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100133;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .sigmvl[ig - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100133;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .dpsvl[ig - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100133;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& syn_ .e0, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100133;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main1_ .ejv[id - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100133;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .ejvl[ig - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100133;
	    }
	    erro_ .ierro = e_wsfe();
L100133:
 
	    ;
	} else if (main1_ .pstop[ia - 1] && main1_ .pstop[ig - 1]) {
	    erro_ .ierro = s_wsfe(&io___4639);
	    if (erro_ .ierro != 0) {
		goto L100134;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .xvl[(ia << 1) - 2], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100134;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .yvl[(ia << 1) - 2], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100134;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .xvl[(ia << 1) - 1], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100134;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .yvl[(ia << 1) - 1], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100134;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .sigmvl[ia - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100134;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .dpsvl[ia - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100134;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .xvl[(ig << 1) - 2], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100134;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .yvl[(ig << 1) - 2], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100134;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .xvl[(ig << 1) - 1], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100134;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .yvl[(ig << 1) - 1], 
		    (ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100134;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .sigmvl[ig - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100134;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .dpsvl[ig - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100134;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& syn_ .e0, (ftnlen)sizeof(
		    doublereal));
	    if (erro_ .ierro != 0) {
		goto L100134;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .ejvl[ia - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100134;
	    }
	    erro_ .ierro = do_fio(&c__1, (char *)& main2_ .ejvl[ig - 1], (
		    ftnlen)sizeof(doublereal));
	    if (erro_ .ierro != 0) {
		goto L100134;
	    }
	    erro_ .ierro = e_wsfe();
L100134:
	    ;
	}
 
    }
    if (erro_ .ierro != 0) {
	s_wsle(&io___4640);
	do_lio(&c__9, &c__1, "Warning from write6: fort.12 has ", 33L);
	do_lio(&c__9, &c__1, "corrupted output probably due to lost particles"
		, 47L);
	e_wsle();
    }
    flush_(&c__6);
    flush_(&c__12);
    return 0;
}  

 
 
  int writebin_(nthinerr)
integer *nthinerr;
{
     
    integer i__1, i__2;

     
    integer s_wsue(), do_uio(), e_wsue(), s_wsle(), e_wsle(), do_lio();

     
    static integer ia, ie, ia2;
    extern   int flush_();

     
    static cilist io___4644 = { 1, 0, 0, 0, 0 };
    static cilist io___4645 = { 1, 0, 0, 0, 0 };
    static cilist io___4646 = { 0, 6, 0, 0, 0 };
    static cilist io___4647 = { 0, 6, 0, 0, 0 };
    static cilist io___4648 = { 0, 6, 0, 0, 0 };
    static cilist io___4649 = { 0, 6, 0, 0, 0 };


 


 
 

 
 

    i__1 = tra1_ .napx;
    for (ia = 1; ia <= i__1; ++ia) {
	if (! main1_ .pstop[main1_ .nlostp[ia - 1] - 1] && ! main1_ .pstop[
		main1_ .nlostp[ia - 1]] && main1_ .nlostp[ia - 1] % 2 != 0) {
	    ia2 = (main1_ .nlostp[ia - 1] + 1) / 2;
	    ie = ia + 1;
	    if (tra1_ .ntwin != 2) {
		io___4644.ciunit = 91 - ia2;
		erro_ .ierro = s_wsue(&io___4644);
		if (erro_ .ierro != 0) {
		    goto L100135;
		}
		erro_ .ierro = do_uio(&c__1, (char *)& main4_ .numx, (ftnlen)
			sizeof(integer));
		if (erro_ .ierro != 0) {
		    goto L100135;
		}
		erro_ .ierro = do_uio(&c__1, (char *)& main1_ .nlostp[ia - 1], 
			(ftnlen)sizeof(integer));
		if (erro_ .ierro != 0) {
		    goto L100135;
		}
		erro_ .ierro = do_uio(&c__1, (char *)& main1_ .dam[ia - 1], (
			ftnlen)sizeof(doublereal));
		if (erro_ .ierro != 0) {
		    goto L100135;
		}
		erro_ .ierro = do_uio(&c__1, (char *)& main1_ .xv[(ia << 1) - 
			2], (ftnlen)sizeof(doublereal));
		if (erro_ .ierro != 0) {
		    goto L100135;
		}
		erro_ .ierro = do_uio(&c__1, (char *)& main1_ .yv[(ia << 1) - 
			2], (ftnlen)sizeof(doublereal));
		if (erro_ .ierro != 0) {
		    goto L100135;
		}
		erro_ .ierro = do_uio(&c__1, (char *)& main1_ .xv[(ia << 1) - 
			1], (ftnlen)sizeof(doublereal));
		if (erro_ .ierro != 0) {
		    goto L100135;
		}
		erro_ .ierro = do_uio(&c__1, (char *)& main1_ .yv[(ia << 1) - 
			1], (ftnlen)sizeof(doublereal));
		if (erro_ .ierro != 0) {
		    goto L100135;
		}
		erro_ .ierro = do_uio(&c__1, (char *)& main1_ .sigmv[ia - 1], (
			ftnlen)sizeof(doublereal));
		if (erro_ .ierro != 0) {
		    goto L100135;
		}
		erro_ .ierro = do_uio(&c__1, (char *)& main1_ .dpsv[ia - 1], (
			ftnlen)sizeof(doublereal));
		if (erro_ .ierro != 0) {
		    goto L100135;
		}
		erro_ .ierro = do_uio(&c__1, (char *)& syn_ .e0, (ftnlen)
			sizeof(doublereal));
		if (erro_ .ierro != 0) {
		    goto L100135;
		}
		erro_ .ierro = e_wsue();
L100135:
		i__2 = 91 - ia2;
		flush_(&i__2);
	    } else {
		io___4645.ciunit = 91 - ia2;
		erro_ .ierro = s_wsue(&io___4645);
		if (erro_ .ierro != 0) {
		    goto L100136;
		}
		erro_ .ierro = do_uio(&c__1, (char *)& main4_ .numx, (ftnlen)
			sizeof(integer));
		if (erro_ .ierro != 0) {
		    goto L100136;
		}
		erro_ .ierro = do_uio(&c__1, (char *)& main1_ .nlostp[ia - 1], 
			(ftnlen)sizeof(integer));
		if (erro_ .ierro != 0) {
		    goto L100136;
		}
		erro_ .ierro = do_uio(&c__1, (char *)& main1_ .dam[ia - 1], (
			ftnlen)sizeof(doublereal));
		if (erro_ .ierro != 0) {
		    goto L100136;
		}
		erro_ .ierro = do_uio(&c__1, (char *)& main1_ .xv[(ia << 1) - 
			2], (ftnlen)sizeof(doublereal));
		if (erro_ .ierro != 0) {
		    goto L100136;
		}
		erro_ .ierro = do_uio(&c__1, (char *)& main1_ .yv[(ia << 1) - 
			2], (ftnlen)sizeof(doublereal));
		if (erro_ .ierro != 0) {
		    goto L100136;
		}
		erro_ .ierro = do_uio(&c__1, (char *)& main1_ .xv[(ia << 1) - 
			1], (ftnlen)sizeof(doublereal));
		if (erro_ .ierro != 0) {
		    goto L100136;
		}
		erro_ .ierro = do_uio(&c__1, (char *)& main1_ .yv[(ia << 1) - 
			1], (ftnlen)sizeof(doublereal));
		if (erro_ .ierro != 0) {
		    goto L100136;
		}
		erro_ .ierro = do_uio(&c__1, (char *)& main1_ .sigmv[ia - 1], (
			ftnlen)sizeof(doublereal));
		if (erro_ .ierro != 0) {
		    goto L100136;
		}
		erro_ .ierro = do_uio(&c__1, (char *)& main1_ .dpsv[ia - 1], (
			ftnlen)sizeof(doublereal));
		if (erro_ .ierro != 0) {
		    goto L100136;
		}
		erro_ .ierro = do_uio(&c__1, (char *)& syn_ .e0, (ftnlen)
			sizeof(doublereal));
		if (erro_ .ierro != 0) {
		    goto L100136;
		}
		i__2 = main1_ .nlostp[ia - 1] + 1;
		erro_ .ierro = do_uio(&c__1, (char *)&i__2, (ftnlen)sizeof(
			integer));
		if (erro_ .ierro != 0) {
		    goto L100136;
		}
		erro_ .ierro = do_uio(&c__1, (char *)& main1_ .dam[ia - 1], (
			ftnlen)sizeof(doublereal));
		if (erro_ .ierro != 0) {
		    goto L100136;
		}
		erro_ .ierro = do_uio(&c__1, (char *)& main1_ .xv[(ie << 1) - 
			2], (ftnlen)sizeof(doublereal));
		if (erro_ .ierro != 0) {
		    goto L100136;
		}
		erro_ .ierro = do_uio(&c__1, (char *)& main1_ .yv[(ie << 1) - 
			2], (ftnlen)sizeof(doublereal));
		if (erro_ .ierro != 0) {
		    goto L100136;
		}
		erro_ .ierro = do_uio(&c__1, (char *)& main1_ .xv[(ie << 1) - 
			1], (ftnlen)sizeof(doublereal));
		if (erro_ .ierro != 0) {
		    goto L100136;
		}
		erro_ .ierro = do_uio(&c__1, (char *)& main1_ .yv[(ie << 1) - 
			1], (ftnlen)sizeof(doublereal));
		if (erro_ .ierro != 0) {
		    goto L100136;
		}
		erro_ .ierro = do_uio(&c__1, (char *)& main1_ .sigmv[ie - 1], (
			ftnlen)sizeof(doublereal));
		if (erro_ .ierro != 0) {
		    goto L100136;
		}
		erro_ .ierro = do_uio(&c__1, (char *)& main1_ .dpsv[ie - 1], (
			ftnlen)sizeof(doublereal));
		if (erro_ .ierro != 0) {
		    goto L100136;
		}
		erro_ .ierro = do_uio(&c__1, (char *)& syn_ .e0, (ftnlen)
			sizeof(doublereal));
		if (erro_ .ierro != 0) {
		    goto L100136;
		}
		erro_ .ierro = e_wsue();
L100136:
		i__2 = 91 - ia2;
		flush_(&i__2);
	    }
	    if (erro_ .ierro != 0) {
		s_wsle(&io___4646);
		e_wsle();
		s_wsle(&io___4647);
		do_lio(&c__9, &c__1, "*** ERROR ***,PROBLEMS WRITTING TO FILE # : ", 44L);
		i__2 = 91 - ia2;
		do_lio(&c__3, &c__1, (char *)&i__2, (ftnlen)sizeof(integer));
		e_wsle();
		s_wsle(&io___4648);
		do_lio(&c__9, &c__1, "ERROR CODE : ", 13L);
		do_lio(&c__3, &c__1, (char *)& erro_ .ierro, (ftnlen)sizeof(
			integer));
		e_wsle();
		s_wsle(&io___4649);
		e_wsle();
		flush_(&c__6);
		flush_(&c__12);
		*nthinerr = 3000;
		return 0;
	    }
	}
 
    }
    return 0;
}  

 
 
  int writelin_(nr, typ, tl, p1, t, ixwl, typ_len)
integer *nr;
char *typ;
doublereal *tl, *p1, *t;
integer *ixwl;
ftnlen typ_len;
{
     
    static char fmt_10000[] = "(\002|\002,i6,\002|\002,a8,\002|\002,f12.5,\002|\002,\002X\002,\002|\002,f12.7,\002|\002,f12.6,\002|\002,f13.7,\002|\002,f11.6,\002|\002,f11.7,\002|\002,f11.7,\002|\002,f11.7,\002|\002,f11.7,\002|\002)";
    static char fmt_10010[] = "(\002|\002,6x,\002|\002,8x,\002|\002,12x,\002|\002,1x,\002|\002,12x,\002|\002,f12.6,\002|\002,f13.7,\002|\002,f11.6,\002|\002,11x,\002|\002,11x,\002|\002,11x,\002|\002,11x,\002|\002)";
    static char fmt_10030[] = "(\002|\002,6x,\002|\002,a8,\002|\002,12x,\002|\002,102(\002-\002))";
    static char fmt_10020[] = "(\002|\002,6x,\002|\002,8x,\002|\002,12x,\002|\002,\002Z\002,\002|\002,f12.7,\002|\002,f12.6,\002|\002,f13.7,\002|\002,f11.6,\002|\002,f11.7,\002|\002,f11.7,\002|\002,f11.7,\002|\002,f11.7,\002|\002)";
    static char fmt_10040[] = "(132(\002-\002))";

     
    integer i__1;

     
    integer s_cmp();
    double sqrt();
    integer s_wsfe(), do_fio(), e_wsfe();

     
    static doublereal c__[2], d__[2];
    static integer i__, l;
    static doublereal b1[2], b2[2], g1[2], g2[2], dp[2], cp[2];
    static integer ll;
    static doublereal al1[2], al2[2];
    extern   int error_();
    static integer iwrite;

     
    static cilist io___4664 = { 0, 6, 0, fmt_10000, 0 };
    static cilist io___4665 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___4666 = { 0, 6, 0, fmt_10030, 0 };
    static cilist io___4667 = { 0, 6, 0, fmt_10020, 0 };
    static cilist io___4668 = { 0, 6, 0, fmt_10010, 0 };
    static cilist io___4669 = { 0, 6, 0, fmt_10040, 0 };


 

 
 

 

     
    t -= 7;
    --p1;

     
    iwrite = 0;
    if (linop_ .nlin == 0) {
	iwrite = 1;
    } else {
	i__1 = linop_ .nlin;
	for (i__ = 1; i__ <= i__1; ++i__) {
	    if (s_cmp(typ, linopc_ .bezl + (i__ - 1 << 4), 16L, 16L) == 0) {
		iwrite = 1;
	    }
 
	}
    }
    if (iwrite == 1) {
	for (l = 1; l <= 2; ++l) {
	    ll = l << 1;
	    b1[l - 1] = t[ll + (ll - 1) * 6] * t[ll + (ll - 1) * 6] + t[ll + 
		    1 + (ll - 1) * 6] * t[ll + 1 + (ll - 1) * 6];
	    b2[l - 1] = t[6 - ll + (ll - 1) * 6] * t[6 - ll + (ll - 1) * 6] + 
		    t[7 - ll + (ll - 1) * 6] * t[7 - ll + (ll - 1) * 6];
	    al1[l - 1] = -(t[ll + (ll - 1) * 6] * t[ll + ll * 6] + t[ll + 1 + 
		    (ll - 1) * 6] * t[ll + 1 + ll * 6]);
	    al2[l - 1] = -(t[6 - ll + (ll - 1) * 6] * t[6 - ll + ll * 6] + t[
		    7 - ll + (ll - 1) * 6] * t[7 - ll + ll * 6]);
	    g1[l - 1] = t[ll + ll * 6] * t[ll + ll * 6] + t[ll + 1 + ll * 6] *
		     t[ll + 1 + ll * 6];
	    g2[l - 1] = t[6 - ll + ll * 6] * t[6 - ll + ll * 6] + t[7 - ll + 
		    ll * 6] * t[7 - ll + ll * 6];
	    d__[l - 1] = t[(ll - 1) * 6 + 6] * .001;
	    dp[l - 1] = t[ll * 6 + 6] * .001;
	    c__[l - 1] = t[(ll - 1) * 6 + 1];
	    cp[l - 1] = t[ll * 6 + 1];
 
	}
	if (ell_ .kz[*ixwl - 1] == 20 && beam_ .nbeam >= 1) {
	    if (beam_ .nvbeam == -1) {
		beam_ .sigman6[(*ixwl << 1) - 2] = sqrt(beam_ .emitnx * 
			beam_ .gammar * b1[0]);
		beam_ .sigman6[(*ixwl << 1) - 1] = sqrt(beam_ .emitnz * 
			beam_ .gammar * b1[1]);
		if (beam_ .sigman6[(*ixwl << 1) - 2] <= 1e-17 || 
			beam_ .sigman6[(*ixwl << 1) - 1] <= 1e-17) {
		    error_(&c__88);
		}
	    } else if (beam_ .nvbeam != 0) {
		beam_ .sigman[(beam_ .nvbeam + (*ixwl << 6) << 1) - 130] = 
			sqrt(beam_ .emitnx * beam_ .gammar * b1[0]);
		beam_ .sigman[(beam_ .nvbeam + (*ixwl << 6) << 1) - 129] = 
			sqrt(beam_ .emitnz * beam_ .gammar * b1[1]);
		if (beam_ .sigman[(beam_ .nvbeam + (*ixwl << 6) << 1) - 130] 
			<= 1e-17 || beam_ .sigman[(beam_ .nvbeam + (*ixwl << 
			6) << 1) - 129] <= 1e-17) {
		    error_(&c__88);
		}
		if (tra1_ .iclo6 != 1 && tra1_ .iclo6 != 2) {
		    beam_ .clobeam[(beam_ .nvbeam + (*ixwl << 6) << 1) - 130] 
			    = c__[0];
		    beam_ .clobeam[(beam_ .nvbeam + (*ixwl << 6) << 1) - 129] 
			    = c__[1];
		}
	    } else if (beam_ .nvbeam == 0 && (tra1_ .iclo6 != 1 && 
		    tra1_ .iclo6 != 2)) {
		beam_ .sigman6[(*ixwl << 1) - 2] = sqrt(beam_ .emitnx * 
			beam_ .gammar * b1[0]);
		beam_ .sigman6[(*ixwl << 1) - 1] = sqrt(beam_ .emitnz * 
			beam_ .gammar * b1[1]);
		if (beam_ .sigman6[(*ixwl << 1) - 2] <= 1e-17 || 
			beam_ .sigman6[(*ixwl << 1) - 1] <= 1e-17) {
		    error_(&c__88);
		}
		beam_ .clobeam[(beam_ .nvbeam + (*ixwl << 6) << 1) - 130] = 
			c__[0];
		beam_ .clobeam[(beam_ .nvbeam + (*ixwl << 6) << 1) - 129] = 
			c__[1];
	    }
	}
	if (clos_ .ncorru == 0) {
	    s_wsfe(&io___4664);
	    do_fio(&c__1, (char *)&(*nr), (ftnlen)sizeof(integer));
	    do_fio(&c__1, typ, 8L);
	    do_fio(&c__1, (char *)&(*tl), (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&p1[1], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&b1[0], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&al1[0], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&g1[0], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&d__[0], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&dp[0], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&c__[0], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&cp[0], (ftnlen)sizeof(doublereal));
	    e_wsfe();
	    s_wsfe(&io___4665);
	    do_fio(&c__1, (char *)&b2[0], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&al2[0], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&g2[0], (ftnlen)sizeof(doublereal));
	    e_wsfe();
	    s_wsfe(&io___4666);
	    do_fio(&c__1, typ + 8, 8L);
	    e_wsfe();
	    s_wsfe(&io___4667);
	    do_fio(&c__1, (char *)&p1[2], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&b1[1], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&al1[1], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&g1[1], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&d__[1], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&dp[1], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&c__[1], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&cp[1], (ftnlen)sizeof(doublereal));
	    e_wsfe();
	    s_wsfe(&io___4668);
	    do_fio(&c__1, (char *)&b2[1], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&al2[1], (ftnlen)sizeof(doublereal));
	    do_fio(&c__1, (char *)&g2[1], (ftnlen)sizeof(doublereal));
	    e_wsfe();
	    s_wsfe(&io___4669);
	    e_wsfe();
	} else {
	    if (ell_ .kp[*ixwl - 1] == 3) {
		++ cororb_ .nhmoni;
		cororb_ .betam[cororb_ .nhmoni - 1] = b1[0];
		cororb_ .pam[cororb_ .nhmoni - 1] = p1[1] * 2 * kons_ .pi;
		cororb_ .bclorb[cororb_ .nhmoni - 1] = c__[0];
	    } else if (ell_ .kp[*ixwl - 1] == 4) {
		++ cororb_ .nhcorr;
		cororb_ .betac[cororb_ .nhcorr - 1] = b1[0];
		cororb_ .pac[cororb_ .nhcorr - 1] = p1[1] * 2 * kons_ .pi;
	    } else if (ell_ .kp[*ixwl - 1] == -3) {
		++ cororb_ .nvmoni;
		cororb_ .betam[cororb_ .nvmoni + 599] = b1[1];
		cororb_ .pam[cororb_ .nvmoni + 599] = p1[2] * 2 * kons_ .pi;
		cororb_ .bclorb[cororb_ .nvmoni + 599] = c__[1];
	    } else if (ell_ .kp[*ixwl - 1] == -4) {
		++ cororb_ .nvcorr;
		cororb_ .betac[cororb_ .nvcorr + 599] = b1[1];
		cororb_ .pac[cororb_ .nvcorr + 599] = p1[2] * 2 * kons_ .pi;
	    }
	}
    }
 

    return 0;
}  

 
 
  int wzset_()
{
     
    doublereal d__1, d__2;

     
    static integer i__, j, k;
    static doublereal wi, wr;
    extern   int mywwerf_();


 


 

 

 
 
 

 

 
 

 

 

 


 
    wzcom1_ .hrecip = 63.;
    wzcom1_ .kstep = 492;
    k = 0;
    for (j = 0; j <= 471; ++j) {
	for (i__ = 0; i__ <= 491; ++i__) {
	    ++k;
	    d__1 = i__ * .015873015873015872;
	    d__2 = j * .015873015873015872;
	    mywwerf_(&d__1, &d__2, &wr, &wi);
	    wzcom2_ .wtreal[k - 1] = wr;
	    wzcom2_ .wtimag[k - 1] = wi;
 
	}
 
    }
}  

  int wzsubf_(x, y, u, v, ix, nbeam)
integer *x, *y, *u, *v, *ix, *nbeam;
{
     
    doublereal d__1;

     
    static integer k, p, q, r__, t;
    static doublereal ti;
    static integer xh, yh, mu, nu;
    static doublereal tr, w1i, w2i, w3i, w4i, w1r, w2r, w3r, w4r, d12i, d23i, 
	    d34i, d12r, d23r, d34r, dmu, dnu;
    static integer qsq;
    static doublereal two;
    static integer idaa;
    extern doublereal dare_();
    static integer usum, vsum;
    extern   int dacad_(), daadd_(), dadic_(), dadal_();
    static integer usum3, vsum3;
    extern   int daall_(), dacop_();
    static doublereal tdd13i;
    extern   int dacmu_();
    static doublereal tdd24i, tdddi;
    extern   int dakey_(), dasub_(), dacsu_();
    static integer simag;
    static doublereal tdd13r, tdddr, tdd24r;
    extern   int damul_();
    static integer sreal, xhrel, yhrel;

 

 
 
 
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 
 
 
    if (dial_ .idalloc == 1 || dial_ .idalloc == 3) {
	dakey_("FOX V2.1", 8L);
	daall_(&xh, &c__1, "XH        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&yh, &c__1, "YH        ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&xhrel, &c__1, "XHREL     ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&yhrel, &c__1, "YHREL     ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&usum3, &c__1, "USUM3     ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&vsum3, &c__1, "VSUM3     ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&usum, &c__1, "USUM      ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&vsum, &c__1, "VSUM      ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&p, &c__1, "P         ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&q, &c__1, "Q         ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&qsq, &c__1, "QSQ       ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&t, &c__1, "T         ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&r__, &c__1, "R         ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&sreal, &c__1, "SREAL     ", & dial_ .nord, & dial_ .nvar, 10L);
	daall_(&simag, &c__1, "SIMAG     ", & dial_ .nord, & dial_ .nvar, 10L);
    }
    idaa = dascr_ .idao;
 
 

    if (dial_ .idalloc == 1) {
	dial_ .idalloc = 0;
    }
    if (dial_ .idalloc == 3) {
	dial_ .idalloc = 2;
    }
 


 


 

 

 

 

 

 
 

 
 
 
 

 

 


 
    if (dare_(x) >= 7.77 || dare_(y) >= 7.46) {
	goto L1000;
    }

 
 

 

 

 

 
 
 

 


    two = 2.;
 

    d__1 = wzcom1_ .hrecip * 1.;
    dacmu_(x, &d__1, & dascr_ .iscrda[idaa]);
    dacop_(& dascr_ .iscrda[idaa], &xh);
 

    d__1 = wzcom1_ .hrecip * 1.;
    dacmu_(y, &d__1, & dascr_ .iscrda[idaa]);
    dacop_(& dascr_ .iscrda[idaa], &yh);
    mu = (integer) dare_(&xh);
    nu = (integer) dare_(&yh);
 
    k = mu + 2 + nu * wzcom1_ .kstep;
    w4r = wzcom2_ .wtreal[k - 1];
    w4i = wzcom2_ .wtimag[k - 1];
    --k;
    w3r = wzcom2_ .wtreal[k - 1];
    w3i = wzcom2_ .wtimag[k - 1];
    d34r = w4r - w3r;
    d34i = w4i - w3i;
    k += wzcom1_ .kstep;
    w2r = wzcom2_ .wtreal[k - 1];
    w2i = wzcom2_ .wtimag[k - 1];
    d23r = w2i - w3i;
    d23i = w3r - w2r;
    tr = d23r - d34r;
    ti = d23i - d34i;
    tdd24r = ti - tr;
    tdd24i = -(tr + ti);
    ++k;
    w1r = wzcom2_ .wtreal[k - 1];
    w1i = wzcom2_ .wtimag[k - 1];
    d12r = w1r - w2r;
    d12i = w1i - w2i;
    tr = d12r - d23r;
    ti = d12i - d23i;
    tdd13r = tr + ti;
    tdd13i = ti - tr;
    tdddr = tdd13i - tdd24i;
    tdddi = tdd24r - tdd13r;
 
    dmu = (doublereal) mu;
    dnu = (doublereal) nu;
 

    d__1 = dmu * 1.;
    dacsu_(&xh, &d__1, & dascr_ .iscrda[idaa]);
    dacop_(& dascr_ .iscrda[idaa], &xhrel);
 

    d__1 = dnu * 1.;
    dacsu_(&yh, &d__1, & dascr_ .iscrda[idaa]);
    dacop_(& dascr_ .iscrda[idaa], &yhrel);
 

    d__1 = tdddr * 1.;
    dacmu_(&xhrel, &d__1, & dascr_ .iscrda[idaa]);
    d__1 = tdddi * 1.;
    dacmu_(&yhrel, &d__1, & dascr_ .iscrda[idaa + 1]);
    dasub_(& dascr_ .iscrda[idaa], & dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[
	    idaa + 2]);
    d__1 = tdd13r * 1.;
    dacad_(& dascr_ .iscrda[idaa + 2], &d__1, & dascr_ .iscrda[idaa + 3]);
    dacmu_(& dascr_ .iscrda[idaa + 3], &c_b461, & dascr_ .iscrda[idaa + 4]);
    dacop_(& dascr_ .iscrda[idaa + 4], &usum3);
 

    d__1 = tdddi * 1.;
    dacmu_(&xhrel, &d__1, & dascr_ .iscrda[idaa]);
    d__1 = tdddr * 1.;
    dacmu_(&yhrel, &d__1, & dascr_ .iscrda[idaa + 1]);
    daadd_(& dascr_ .iscrda[idaa], & dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[
	    idaa + 2]);
    d__1 = tdd13i * 1.;
    dacad_(& dascr_ .iscrda[idaa + 2], &d__1, & dascr_ .iscrda[idaa + 3]);
    dacmu_(& dascr_ .iscrda[idaa + 3], &c_b461, & dascr_ .iscrda[idaa + 4]);
    dacop_(& dascr_ .iscrda[idaa + 4], &vsum3);
 

    dacsu_(&yhrel, &c_b2366, & dascr_ .iscrda[idaa]);
    dacop_(& dascr_ .iscrda[idaa], &yhrel);
 

    damul_(&xhrel, &usum3, & dascr_ .iscrda[idaa]);
    damul_(&yhrel, &vsum3, & dascr_ .iscrda[idaa + 1]);
    dasub_(& dascr_ .iscrda[idaa], & dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[
	    idaa + 2]);
    d__1 = d12r * 1.;
    dacad_(& dascr_ .iscrda[idaa + 2], &d__1, & dascr_ .iscrda[idaa + 3]);
    dacop_(& dascr_ .iscrda[idaa + 3], &usum);
 

    damul_(&xhrel, &vsum3, & dascr_ .iscrda[idaa]);
    damul_(&yhrel, &usum3, & dascr_ .iscrda[idaa + 1]);
    daadd_(& dascr_ .iscrda[idaa], & dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[
	    idaa + 2]);
    d__1 = d12i * 1.;
    dacad_(& dascr_ .iscrda[idaa + 2], &d__1, & dascr_ .iscrda[idaa + 3]);
    dacop_(& dascr_ .iscrda[idaa + 3], &vsum);
 

    dacsu_(&xhrel, &c_b2366, & dascr_ .iscrda[idaa]);
    dacop_(& dascr_ .iscrda[idaa], &xhrel);
 

    damul_(&xhrel, &usum, & dascr_ .iscrda[idaa]);
    damul_(&yhrel, &vsum, & dascr_ .iscrda[idaa + 1]);
    dasub_(& dascr_ .iscrda[idaa], & dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[
	    idaa + 2]);
    d__1 = w1r * 1.;
    dacad_(& dascr_ .iscrda[idaa + 2], &d__1, & dascr_ .iscrda[idaa + 3]);
    dacop_(& dascr_ .iscrda[idaa + 3], u);
 

    damul_(&xhrel, &vsum, & dascr_ .iscrda[idaa]);
    damul_(&yhrel, &usum, & dascr_ .iscrda[idaa + 1]);
    daadd_(& dascr_ .iscrda[idaa], & dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[
	    idaa + 2]);
    d__1 = w1i * 1.;
    dacad_(& dascr_ .iscrda[idaa + 2], &d__1, & dascr_ .iscrda[idaa + 3]);
    dacop_(& dascr_ .iscrda[idaa + 3], v);
    goto L2000;

 

 
 
 
 
 
 
 
 

L1000:
 

    damul_(x, x, & dascr_ .iscrda[idaa]);
    damul_(y, y, & dascr_ .iscrda[idaa + 1]);
    dasub_(& dascr_ .iscrda[idaa], & dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[
	    idaa + 2]);
    dacop_(& dascr_ .iscrda[idaa + 2], &p);
 

    d__1 = two * 1.;
    dacmu_(x, &d__1, & dascr_ .iscrda[idaa]);
    damul_(& dascr_ .iscrda[idaa], y, & dascr_ .iscrda[idaa + 1]);
    dacop_(& dascr_ .iscrda[idaa + 1], &q);
 

    damul_(&q, &q, & dascr_ .iscrda[idaa]);
    dacop_(& dascr_ .iscrda[idaa], &qsq);
 
 

    dacsu_(&p, &c_b11165, & dascr_ .iscrda[idaa]);
    dacop_(& dascr_ .iscrda[idaa], &t);
 

    damul_(&t, &t, & dascr_ .iscrda[idaa]);
    daadd_(& dascr_ .iscrda[idaa], &qsq, & dascr_ .iscrda[idaa + 1]);
    dadic_(& dascr_ .iscrda[idaa + 1], &c_b11166, & dascr_ .iscrda[idaa + 2]);
    dacop_(& dascr_ .iscrda[idaa + 2], &r__);
 

    damul_(&r__, &t, & dascr_ .iscrda[idaa]);
    dacop_(& dascr_ .iscrda[idaa], &sreal);
 

    dacmu_(&r__, &c_b2381, & dascr_ .iscrda[idaa]);
    damul_(& dascr_ .iscrda[idaa], &q, & dascr_ .iscrda[idaa + 1]);
    dacop_(& dascr_ .iscrda[idaa + 1], &simag);
 
 

    dacsu_(&p, &c_b11168, & dascr_ .iscrda[idaa]);
    dacop_(& dascr_ .iscrda[idaa], &t);
 

    damul_(&t, &t, & dascr_ .iscrda[idaa]);
    daadd_(& dascr_ .iscrda[idaa], &qsq, & dascr_ .iscrda[idaa + 1]);
    dadic_(& dascr_ .iscrda[idaa + 1], &c_b11169, & dascr_ .iscrda[idaa + 2]);
    dacop_(& dascr_ .iscrda[idaa + 2], &r__);
 

    damul_(&r__, &t, & dascr_ .iscrda[idaa]);
    daadd_(&sreal, & dascr_ .iscrda[idaa], & dascr_ .iscrda[idaa + 1]);
    dacop_(& dascr_ .iscrda[idaa + 1], &sreal);
 

    damul_(&r__, &q, & dascr_ .iscrda[idaa]);
    dasub_(&simag, & dascr_ .iscrda[idaa], & dascr_ .iscrda[idaa + 1]);
    dacop_(& dascr_ .iscrda[idaa + 1], &simag);
 
 

    damul_(y, &sreal, & dascr_ .iscrda[idaa]);
    damul_(x, &simag, & dascr_ .iscrda[idaa + 1]);
    daadd_(& dascr_ .iscrda[idaa], & dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[
	    idaa + 2]);
    dacmu_(& dascr_ .iscrda[idaa + 2], &c_b2381, & dascr_ .iscrda[idaa + 3]);
    dacop_(& dascr_ .iscrda[idaa + 3], u);
 

    damul_(x, &sreal, & dascr_ .iscrda[idaa]);
    damul_(y, &simag, & dascr_ .iscrda[idaa + 1]);
    dasub_(& dascr_ .iscrda[idaa], & dascr_ .iscrda[idaa + 1], & dascr_ .iscrda[
	    idaa + 2]);
    dacop_(& dascr_ .iscrda[idaa + 2], v);
L2000:
    if (dial_ .idalloc == 2 && *ix == *nbeam) {
	dadal_(&simag, &c__1);
	dadal_(&sreal, &c__1);
	dadal_(&r__, &c__1);
	dadal_(&t, &c__1);
	dadal_(&qsq, &c__1);
	dadal_(&q, &c__1);
	dadal_(&p, &c__1);
	dadal_(&vsum, &c__1);
	dadal_(&usum, &c__1);
	dadal_(&vsum3, &c__1);
	dadal_(&usum3, &c__1);
	dadal_(&yhrel, &c__1);
	dadal_(&xhrel, &c__1);
	dadal_(&yh, &c__1);
	dadal_(&xh, &c__1);
 
    }
    return 0;
}  

  int wzsubv_(napx, vx, vy, vu, vv)
integer *napx;
doublereal *vx, *vy, *vu, *vv;
{
     
    integer i__1;
    doublereal d__1, d__2, d__3;

     
    double d_sign();
    integer i_dnnt();

     
    static integer j, k;
    static doublereal vp[64], vq[64], vt[64], vr[64], ss, vti[64], vxh[64], 
	    vyh[64];
    static integer vmu[64], vnu[64];
    static doublereal vtr[64], vw1i[64], vw2i[64], vw3i[64], vw4i[64], vw1r[
	    64], vw2r[64], vw3r[64], vw4r[64], vd12i[64], vd23i[64], vd34i[64]
	    , vd12r[64], vd34r[64], vd23r[64], vqsq[64], vusum[64], vvsum[64],
	     vusum3[64], vvsum3[64], vtdd13i[64], vtdddi[64], vtdd24i[64], 
	    vsimag[64], vtdd13r[64], vtdd24r[64], vtdddr[64], vsreal[64], 
	    vxhrel[64], vyhrel[64];


 

 

 

 


 

 

 

 

 

 
 

 
 
 
 

 

 


 
 

 
 

 

 
 
 


 
 
 
 
 
 
 
 
 

 


 
     
    --vv;
    --vu;
    --vy;
    --vx;

     
    ss = 0.;
    i__1 = *napx;
    for (j = 1; j <= i__1; ++j) {
 
	d__2 = vx[j] - 7.77;
	d__3 = vy[j] - 7.46;
	d__1 = d_sign(&c_b2366, &d__2) + d_sign(&c_b2366, &d__3);
	ss += d_sign(&c_b2366, &d__1);
 
    }

    if (i_dnnt(&ss) == *napx) {
 
	i__1 = *napx;
	for (j = 1; j <= i__1; ++j) {
 
	    d__1 = vx[j];
 
	    d__2 = vy[j];
	    vp[j - 1] = d__1 * d__1 - d__2 * d__2;
	    vq[j - 1] = vx[j] * 2. * vy[j];
 
	    d__1 = vq[j - 1];
	    vqsq[j - 1] = d__1 * d__1;
 
	    vt[j - 1] = vp[j - 1] - .2752551286;
 
	    d__1 = vt[j - 1];
	    vr[j - 1] = .5124242248 / (d__1 * d__1 + vqsq[j - 1]);
	    vsreal[j - 1] = vr[j - 1] * vt[j - 1];
	    vsimag[j - 1] = -vr[j - 1] * vq[j - 1];
 
	    vt[j - 1] = vp[j - 1] - 2.7247448714;
 
	    d__1 = vt[j - 1];
	    vr[j - 1] = .0517653588 / (d__1 * d__1 + vqsq[j - 1]);
	    vsreal[j - 1] += vr[j - 1] * vt[j - 1];
	    vsimag[j - 1] -= vr[j - 1] * vq[j - 1];
 
	    vu[j] = -(vy[j] * vsreal[j - 1] + vx[j] * vsimag[j - 1]);
	    vv[j] = vx[j] * vsreal[j - 1] - vy[j] * vsimag[j - 1];
 
	}
    } else if (i_dnnt(&ss) != -(*napx)) {
 
	i__1 = *napx;
	for (j = 1; j <= i__1; ++j) {
	    if (vx[j] >= 7.77 || vy[j] >= 7.46) {
 
		d__1 = vx[j];
 
		d__2 = vy[j];
		vp[j - 1] = d__1 * d__1 - d__2 * d__2;
		vq[j - 1] = vx[j] * 2. * vy[j];
 
		d__1 = vq[j - 1];
		vqsq[j - 1] = d__1 * d__1;
 
		vt[j - 1] = vp[j - 1] - .2752551286;
 
		d__1 = vt[j - 1];
		vr[j - 1] = .5124242248 / (d__1 * d__1 + vqsq[j - 1]);
		vsreal[j - 1] = vr[j - 1] * vt[j - 1];
		vsimag[j - 1] = -vr[j - 1] * vq[j - 1];
 
		vt[j - 1] = vp[j - 1] - 2.7247448714;
 
		d__1 = vt[j - 1];
		vr[j - 1] = .0517653588 / (d__1 * d__1 + vqsq[j - 1]);
		vsreal[j - 1] += vr[j - 1] * vt[j - 1];
		vsimag[j - 1] -= vr[j - 1] * vq[j - 1];
 
		vu[j] = -(vy[j] * vsreal[j - 1] + vx[j] * vsimag[j - 1]);
		vv[j] = vx[j] * vsreal[j - 1] - vy[j] * vsimag[j - 1];
	    } else {
		vxh[j - 1] = wzcom1_ .hrecip * vx[j];
		vyh[j - 1] = wzcom1_ .hrecip * vy[j];
		vmu[j - 1] = (integer) vxh[j - 1];
		vnu[j - 1] = (integer) vyh[j - 1];
 
		k = vmu[j - 1] + 2 + vnu[j - 1] * wzcom1_ .kstep;
		vw4r[j - 1] = wzcom2_ .wtreal[k - 1];
		vw4i[j - 1] = wzcom2_ .wtimag[k - 1];
		--k;
		vw3r[j - 1] = wzcom2_ .wtreal[k - 1];
		vw3i[j - 1] = wzcom2_ .wtimag[k - 1];
		vd34r[j - 1] = vw4r[j - 1] - vw3r[j - 1];
		vd34i[j - 1] = vw4i[j - 1] - vw3i[j - 1];
		k += wzcom1_ .kstep;
		vw2r[j - 1] = wzcom2_ .wtreal[k - 1];
		vw2i[j - 1] = wzcom2_ .wtimag[k - 1];
		vd23r[j - 1] = vw2i[j - 1] - vw3i[j - 1];
		vd23i[j - 1] = vw3r[j - 1] - vw2r[j - 1];
		vtr[j - 1] = vd23r[j - 1] - vd34r[j - 1];
		vti[j - 1] = vd23i[j - 1] - vd34i[j - 1];
		vtdd24r[j - 1] = vti[j - 1] - vtr[j - 1];
		vtdd24i[j - 1] = -(vtr[j - 1] + vti[j - 1]);
		++k;
		vw1r[j - 1] = wzcom2_ .wtreal[k - 1];
		vw1i[j - 1] = wzcom2_ .wtimag[k - 1];
		vd12r[j - 1] = vw1r[j - 1] - vw2r[j - 1];
		vd12i[j - 1] = vw1i[j - 1] - vw2i[j - 1];
		vtr[j - 1] = vd12r[j - 1] - vd23r[j - 1];
		vti[j - 1] = vd12i[j - 1] - vd23i[j - 1];
		vtdd13r[j - 1] = vtr[j - 1] + vti[j - 1];
		vtdd13i[j - 1] = vti[j - 1] - vtr[j - 1];
		vtdddr[j - 1] = vtdd13i[j - 1] - vtdd24i[j - 1];
		vtdddi[j - 1] = vtdd24r[j - 1] - vtdd13r[j - 1];
 
		vxhrel[j - 1] = vxh[j - 1] - (doublereal) vmu[j - 1];
		vyhrel[j - 1] = vyh[j - 1] - (doublereal) vnu[j - 1];
		vusum3[j - 1] = (vtdd13r[j - 1] + (vxhrel[j - 1] * vtdddr[j - 
			1] - vyhrel[j - 1] * vtdddi[j - 1])) * .5;
		vvsum3[j - 1] = (vtdd13i[j - 1] + (vxhrel[j - 1] * vtdddi[j - 
			1] + vyhrel[j - 1] * vtdddr[j - 1])) * .5;
		vyhrel[j - 1] += -1.;
		vusum[j - 1] = vd12r[j - 1] + (vxhrel[j - 1] * vusum3[j - 1] 
			- vyhrel[j - 1] * vvsum3[j - 1]);
		vvsum[j - 1] = vd12i[j - 1] + (vxhrel[j - 1] * vvsum3[j - 1] 
			+ vyhrel[j - 1] * vusum3[j - 1]);
		vxhrel[j - 1] += -1.;
		vu[j] = vw1r[j - 1] + (vxhrel[j - 1] * vusum[j - 1] - vyhrel[
			j - 1] * vvsum[j - 1]);
		vv[j] = vw1i[j - 1] + (vxhrel[j - 1] * vvsum[j - 1] + vyhrel[
			j - 1] * vusum[j - 1]);
	    }
 
	}
    } else {
 
	i__1 = *napx;
	for (j = 1; j <= i__1; ++j) {
	    vxh[j - 1] = wzcom1_ .hrecip * vx[j];
	    vyh[j - 1] = wzcom1_ .hrecip * vy[j];
	    vmu[j - 1] = (integer) vxh[j - 1];
	    vnu[j - 1] = (integer) vyh[j - 1];
 
	    k = vmu[j - 1] + 2 + vnu[j - 1] * wzcom1_ .kstep;
	    vw4r[j - 1] = wzcom2_ .wtreal[k - 1];
	    vw4i[j - 1] = wzcom2_ .wtimag[k - 1];
	    --k;
	    vw3r[j - 1] = wzcom2_ .wtreal[k - 1];
	    vw3i[j - 1] = wzcom2_ .wtimag[k - 1];
	    vd34r[j - 1] = vw4r[j - 1] - vw3r[j - 1];
	    vd34i[j - 1] = vw4i[j - 1] - vw3i[j - 1];
	    k += wzcom1_ .kstep;
	    vw2r[j - 1] = wzcom2_ .wtreal[k - 1];
	    vw2i[j - 1] = wzcom2_ .wtimag[k - 1];
	    vd23r[j - 1] = vw2i[j - 1] - vw3i[j - 1];
	    vd23i[j - 1] = vw3r[j - 1] - vw2r[j - 1];
	    vtr[j - 1] = vd23r[j - 1] - vd34r[j - 1];
	    vti[j - 1] = vd23i[j - 1] - vd34i[j - 1];
	    vtdd24r[j - 1] = vti[j - 1] - vtr[j - 1];
	    vtdd24i[j - 1] = -(vtr[j - 1] + vti[j - 1]);
	    ++k;
	    vw1r[j - 1] = wzcom2_ .wtreal[k - 1];
	    vw1i[j - 1] = wzcom2_ .wtimag[k - 1];
	    vd12r[j - 1] = vw1r[j - 1] - vw2r[j - 1];
	    vd12i[j - 1] = vw1i[j - 1] - vw2i[j - 1];
	    vtr[j - 1] = vd12r[j - 1] - vd23r[j - 1];
	    vti[j - 1] = vd12i[j - 1] - vd23i[j - 1];
	    vtdd13r[j - 1] = vtr[j - 1] + vti[j - 1];
	    vtdd13i[j - 1] = vti[j - 1] - vtr[j - 1];
	    vtdddr[j - 1] = vtdd13i[j - 1] - vtdd24i[j - 1];
	    vtdddi[j - 1] = vtdd24r[j - 1] - vtdd13r[j - 1];
 
	    vxhrel[j - 1] = vxh[j - 1] - (doublereal) vmu[j - 1];
	    vyhrel[j - 1] = vyh[j - 1] - (doublereal) vnu[j - 1];
	    vusum3[j - 1] = (vtdd13r[j - 1] + (vxhrel[j - 1] * vtdddr[j - 1] 
		    - vyhrel[j - 1] * vtdddi[j - 1])) * .5;
	    vvsum3[j - 1] = (vtdd13i[j - 1] + (vxhrel[j - 1] * vtdddi[j - 1] 
		    + vyhrel[j - 1] * vtdddr[j - 1])) * .5;
	    vyhrel[j - 1] += -1.;
	    vusum[j - 1] = vd12r[j - 1] + (vxhrel[j - 1] * vusum3[j - 1] - 
		    vyhrel[j - 1] * vvsum3[j - 1]);
	    vvsum[j - 1] = vd12i[j - 1] + (vxhrel[j - 1] * vvsum3[j - 1] + 
		    vyhrel[j - 1] * vusum3[j - 1]);
	    vxhrel[j - 1] += -1.;
	    vu[j] = vw1r[j - 1] + (vxhrel[j - 1] * vusum[j - 1] - vyhrel[j - 
		    1] * vvsum[j - 1]);
	    vv[j] = vw1i[j - 1] + (vxhrel[j - 1] * vvsum[j - 1] + vyhrel[j - 
		    1] * vusum[j - 1]);
 
	}
    }
    return 0;
}  

  int xuflow_(i__)
integer *i__;
{
    return 0;
}  

  int maincr_ () { MAIN__ (); }
